Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop casting request headers to HTTPHeaderDict #3344

Merged
merged 1 commit into from Feb 16, 2024

Conversation

pquentin
Copy link
Member

@pquentin pquentin commented Feb 16, 2024

While this was done to fix a mypy error, we did not notice the consequences:

  • This breaks boto3 that subclasses HTTPConnection because HTTPHeaderDict does not support bytes values yet.
  • When proxying, headers are still a dictionary by default.

We can decide to reintroduce a forced conversion to HTTPHeaderDict in urllib3 if the above issues are fixed.

Closes #3343, partly reverts #3134

While this was done to fix a mypy error, we did not notice the
consequences:

 * This breaks boto3 that subclasses HTTPConnection because
   HTTPHeaderDict does not support bytes values yet.
 * When proxying, headers are still a dictionary by default.

We can decide to reintroduce a forced conversion to HTTPHeaderDict in
urllib3 3.0 if the above issues are fixed.
Copy link
Member

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@pquentin pquentin merged commit 49b2dda into urllib3:main Feb 16, 2024
34 of 36 checks passed
@pquentin pquentin mentioned this pull request Feb 16, 2024
13 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

urllib3 2.2 explicitly casts all headers to HTTPHeaderDict
2 participants