Repository navigation
curl_cffi 0.17 admis : en-têtes de l'empreinte lus sans la casse - #6
Merged
Merged
Conversation
lfoletti
marked this pull request as ready for review
November 4, 2026 19:53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Admet curl_cffi 0.17 (
<0.18au lieu de<0.17, borne posée par #5).Cause
Le code d'imitation (
_http.aimpersonate_get) n'a pas de défaut. Avec curl_cffi 0.17, l'aliaschromedésignechrome152, dont l'empreinte envoie ses en-têtes en minuscules (user-agent,accept,sec-ch-ua…), comme Chrome. Le testtest_imitation_envoie_une_empreinte_de_navigateurcopiait les en-têtes reçus dans undictet cherchaitUser-Agentavec sa casse : il ne trouvait rien.Relevé de la CI sous 0.17.0 (diagnostic temporaire, retiré depuis) :
chromeenvoieuser-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) … Chrome/152,sec-ch-ua,sec-fetch-*; avecAccept: text/htmlpassé par l'appelant, un seulAccept, celui de l'appelant.Changement
tests/test_tls_fingerprint.py: en-têtes reçus dans unhttpx.Headers(noms lus sans la casse) ; vérifie en plus que l'Acceptde l'appelant part seul, sans doublon de l'empreinte.pyproject.toml:curl_cffi>=0.15,<0.18.accesspath/ne change.Failing first
FAILED tests/test_tls_fingerprint.py::test_imitation_envoie_une_empreinte_de_navigateur - assert 'Chrome' in ''.python -m pytest tests/test_tls_fingerprint.py -k empreinte_de_navigateur.Codecov
Aucune ligne de code de
accesspath/ne change : rien à couvrir.