Re: [whatwg/fetch] Browsers preserve fragments on redirects (#505)

Is there an existing rationale on making it so that the Response constructor doesn't allow content to specify/override a URL and thereby add/drop the fragment?  Right now the operations available to content script are:
- Forge a URL on a Response in a SW client (but not in a SW) by asking for whatever it wants via fetch() and having the SW respondWith a synthesized Response via Response constructor which will not have a URL.  This is part of the principle that an origin can lie to itself (but currently in limited ways).
  - Because Responses are not Serializable, this can't be propagated via postMessage.
- Drop the URL off a (non-opaque) Response by re-synthesizing it via `new Response(oldResponse.body, oldResponse)`.

If we're planning on making Responses Serializable in the future, it might make sense to make it more possible to control the URL of Responses more directly?

-- 
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/505#issuecomment-778322661

Received on Friday, 12 February 2021 17:12:43 UTC