You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's a discrepancy in how we deal with proxy headers between the two proxy modes.
Currently forwading extends the headers in the request with the proxy_headers argument, but tunneling only includes the proxy_headers. This forces the user into carefully constructing the proxy headers argument depending on the proxy mode which is annoying and also may result in unexpected errors when using the default proxy mode and requesting a mix of HTTP and HTTPS URLs.
To give some context, the proxy_headers are the headers passed down from the httpx.Proxy instances into the httpcore.AsyncHTTPProxy. These headers are set ahead of time as a global "session" configuration by the user as opposed to in a per-request basis, I imagine these being authentication or API-key headers.
I think we should not expect the user to include per-request headers (although we should respect them if they are there), and that httpcore should include the host header in the request headers if necessary and do some minimal cleanup (like preventing encode/httpx#921).
Activity
yeraydiazdiaz commentedon May 4, 2020
To give some context, the
proxy_headersare the headers passed down from thehttpx.Proxyinstances into thehttpcore.AsyncHTTPProxy. These headers are set ahead of time as a global "session" configuration by the user as opposed to in a per-request basis, I imagine these being authentication or API-key headers.I think we should not expect the user to include per-request headers (although we should respect them if they are there), and that httpcore should include the
hostheader in the request headers if necessary and do some minimal cleanup (like preventing encode/httpx#921).yeraydiazdiaz commentedon May 6, 2020
Closed via #77