Fix self.headers got modified during request#41
Open
keatonLiu wants to merge 17 commits intorawandahmad698:masterfrom
Open
Fix self.headers got modified during request#41keatonLiu wants to merge 17 commits intorawandahmad698:masterfrom
keatonLiu wants to merge 17 commits intorawandahmad698:masterfrom
Conversation
added 3 commits
September 29, 2025 19:34
Author
|
Could I know why is it closed? |
Owner
Please resolve the conflicts we can resolve open and merge it today |
Add newest versions for Chrome and Firefox
# Conflicts: # noble_tls/sessions.py
Author
I have resolved the confilcts, please check |
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.
When the
jsonparameter is set,execute_requestdoes not ignore the previously inferredcontent_type, even ifdataisNone.This behavior is caused by the following logic:
The issue is that
self.headersmay have already been modified by a previous request. For example, if the inferredContent-Typeof the previous request wasapplication/x-www-form-urlencoded, it remains inself.headers. As a result, the current request may incorrectly reuse thatContent-Type, which is unexpected whenjsonis used.To fix this, we should:
Content-Type).Content-Typeis already set using theCaseInsensitiveDictbehavior.content_type.This ensures that:
Content-Typeis only applied when truly missing.