Prohibited and unnecessary Connection header #3242
Unanswered
mr-bronson
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In HTTP/2, the Connection header is prohibited, but it still shows up when you look at
response.request.headersfor requests whereresponse.http_version == "HTTP/2".The Connection header is added by _client.py along with three others (Accept, Accept-Encoding, User-Agent) without asking for these headers explicitly.
Even in HTTP/1.1, the value which _client.py sets ("keep-alive") is totally useless because that's the default anyway, if the header is omitted.
Thankfully I found I could omit all these headers with
client.headers.clear().Beta Was this translation helpful? Give feedback.
All reactions