Re: [whatwg/fetch] Script-created redirects responses have no location URL (#1146)

I guess simply removing the location URL is *slightly* tricky because we need a replacement for "If response does not have a location URL or the location URL is not a URL whose scheme is an HTTP(S) scheme" in step 9.6.8 here.
https://html.spec.whatwg.org/multipage/browsing-the-web.html#process-a-navigate-fetch

In particular, we need to decide whether a response with a redirect status code but whose location URL couldn't be extracted is an error or treated as a non-redirect response. Looking at the code, I believe Chrome's behavior, outside of service workers, is:

* If it's not a redirect status code, it's not a redirect.
* If there is no Location header or there are multiple ones, it's not a redirect.
* Otherwise, it is a redirect to whatever string was in that Location header (after goofy escaping per #883). If that URL fails to resolve, it's an error.

(This is mostly an artifact of our net stack's `IsRedirect` function returning either true with an unresolved location string or false.)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/fetch/issues/1146#issuecomment-769397317

Received on Thursday, 28 January 2021 21:11:16 UTC