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
Found a minor issue: if a request redirects from hostname A to hostname B, then the host header from the previous request must be cleared, else it will return a HTTP error 404 (or similar) from the destination server of hostname B.
For what it's worth, request opted to not fix this issue, i.e. to leave the Host header intact on redirects. But I think it's more sensible to remove it. psf/requests#2366
- clearer code when detecting if a custom 'accept-encoding' header is being used.
- allows any casing of `Host`/`host`/`HoSt` header to be removed upon redirect, making the fix to #32 more robust
Found a minor issue: if a request redirects from hostname A to hostname B, then the
host
header from the previous request must be cleared, else it will return a HTTP error 404 (or similar) from the destination server of hostname B.Example httpbin test URL: https://httpbin.org/redirect-to?url=http%3A%2F%2Fexample.com%2F (redirects from httpbin.org to example.com).
Possible fix: add
delete opts.headers['host']
to clear previous request'shost
header inparseOptsUrl()
around line 103.As a sidenote, you probably don't need
delete opts.url
inparseOptsUrl()
at line 103. Should be safe to keepopts.url
.The text was updated successfully, but these errors were encountered: