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

Skip otherwise mandatory headers #1077

Closed
wants to merge 4 commits into from
Closed

Skip otherwise mandatory headers #1077

wants to merge 4 commits into from

Conversation

kanzure
Copy link

@kanzure kanzure commented Dec 31, 2012

This adds support for skip_host and skip_accept_encoding. I bet there are a lot
of ways this could be refactored to not be completely all over the place. This
enables a feature in httplib and http.client from all the way back in py2.4 to
enable/disable the "Host" and "Accept-Encoding" headers.

This breaks a test in urllib3 and the same problem appears in the requests
tests. Hopefully someone can help look into why this test is failing in both
cases.

This allows requests to specify whether or not to include these two
headers. This feature was originally added to httplib in py2.4 to skip
the "Host" header or skip the "Accept-Encoding" header for particularly
annoying servers.
@kanzure
Copy link
Author

kanzure commented Dec 31, 2012

This is related to urllib3/urllib3#138 where I have submitted the underlying urllib3 changes.

@kennethreitz
Copy link
Contributor

Thanks for the pull request, but this is unnecessary.

If you really want to enable this functinality for yourself, you can create a new connection adapter to behave exactly as you expect.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants