Re: [whatwg/fetch] Expected behavior of Response.redirect(null)? (Issue #1764)

Browser behavior is correct here. The processing of USVString arguments is given here: https://webidl.spec.whatwg.org/#js-USVString which defers to https://webidl.spec.whatwg.org/#js-DOMString which defers to https://tc39.es/ecma262/multipage/abstract-operations.html#sec-tostring .

Note that the argument passed to `redirect()` is not reflected in `response.url`, but instead in `response.headers.get("Location")`. You can see that this returns, e.g., `https://example.com/null`, as the result of parsing the relative URL `"null"` against the base URL `https://example.com/`.

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

Message ID: <whatwg/fetch/issues/1764/2251792527@github.com>

Received on Friday, 26 July 2024 01:38:26 UTC