net/http: Add failsafe on status code 301 but response behaves as 200 status code #50579
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
What is the URL of the page with the issue?
https://httpbun.com/status/301
What is your user agent?
Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Screenshot
What did you do?
When you are doing a normal fetch and the response is 301 status code, there should be a fail-safe because some sites are throwing this but returning content and behaves like 200 response, this request keeps failing because they don't send Location header as a normal 301 response should do, the page also have content-type and content-length so maybe be validated by that headers.
This response works when doing curl or visiting from normal browser.
What did you expect to see?
I expect to see the response like a normal fetch when page contains content-length and content-type but no Location header.
What did you see instead?
I get an error message that says the following:
'301 response missing Location header'
The text was updated successfully, but these errors were encountered: