Skip to content
Myr

Set Host header when redirecting cross-origin (#321)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Gaurav Dhameeja · committed by Seth Michael Larson · parent 67d96b6 · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:httpx/middleware.py+1 added-1 removed
146 unmodified lines
147 if url.origin != request.url.origin:148 # Strip Authorization headers when responses are redirected away from149 # the origin.150 del headers["Authorization"]151 del headers["Host"]151 headers["Host"] = url.authority152153 if method != request.method and method == "GET":154 # If we've switch to a 'GET' request, then strip any headers which155 # are only relevant to the request body.
14 unmodified lines