Re: [whatwg/fetch] Return a `content-encoding` header for resource timing and more (PR #1796)

noamr left a comment (whatwg/fetch#1796)

> > To be clear, the header is not exposed to the website passively embedding the resource, but this getter is. I don't think I understand your suggestion, could you rephrase?
> 
> I think the website can get the arbitrary value like this: (I am new to this area so please correct me if I am wrong)
> 
> ```
> let myCoding = myHeaders.get("Content-Encoding");  //  |myCoding| can be a proprietary compression, i.e., an arbitrary value.
> ```

You would only get access to `myHeaders` if this is an actual `fetch` or via a service worker; Those channels are not always available.

> 
> And the reason for that is some use cases involving service workers. See [w3c/resource-timing#381](https://github.com/w3c/resource-timing/issues/381)
> 
> but the `contentEncoding` field in `resourceTiming` is filtered, where only a few pre-determined values are permitted.

Yea, so filtering them when assigning to the struct wouldn't change anything observable, but any future user of that struct would get the filtered value.

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

Message ID: <whatwg/fetch/pull/1796/c2714540441@github.com>

Received on Tuesday, 11 March 2025 14:31:54 UTC