- From: Anne van Kesteren <notifications@github.com>
- Date: Thu, 28 Jan 2021 04:35:37 -0800
- To: whatwg/fetch <fetch@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 28 January 2021 12:35:50 UTC
Ah yeah, #1030 changed that, but we forgot that that this resolved some issues for redirects. It doesn't address the service worker returning non-network redirects however as you note. I rather like Safari's approach here I have to say of requiring an absolute URL (which can we call option (4)?). Did you check exactly when Safari parses? In particular I wonder if they always parse late or do it perhaps when the `Response` object is constructed. ```js const response = new Response(null, { status: 302 }); response.headers.set("Location", "https://example.com/"); ``` vs ```js const response = new Response(null, { status: 302, headers: { Location: "https://example.com/" } }); ``` If they parse late (which I think is what we want and would also align with a recent change to how we determine the MIME type of a response) this would require no changes to the specification (response's URL would be null and passing null into the URL parser for the base URL does the right thing). (Though I do want to make an editorial change makes it clear that all responses have the location URL field. Optional fields are rather messy.) -- 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-769023905
Received on Thursday, 28 January 2021 12:35:50 UTC