Re: [whatwg/fetch] Improve "populate request from client" for null client cases (PR #1820)

domenic left a comment (whatwg/fetch#1820)

So to continue the discussion from https://github.com/whatwg/fetch/pull/1820#discussion_r2067998260, after https://github.com/whatwg/fetch/pull/1821 we'll have the browser UI case handled.

There remains an issue where Fetch currently [states](https://fetch.spec.whatwg.org/#fetch-elsewhere-request) that if you have a null client, you only need to set up origin, policy container, service-workers mode, and referrer. This is incorrect: you also need to set up window. Right now the spec crashes as it [tries to access](https://fetch.spec.whatwg.org/#populate-request-from-client) the request's client's global object, when request's client is null.

There are two possible resolutions for this:

- Just add window to that list of things that are required to be set by callers.
- Automatically set window to "no-window" whenever it is left as the default "client" and client is null.

The latter is only appropriate if we think all non-navigation null-client cases really should suppress client certs/WWW-Authenticate/etc. I think that's probably correct, but maybe I'm wrong.

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

Message ID: <whatwg/fetch/pull/1820/c2841084638@github.com>

Received on Wednesday, 30 April 2025 07:38:00 UTC