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

@annevk commented on this pull request.

I noticed you're participating on behalf of Microsoft. That means you cannot sign the contributor's agreement as an individual. Microsoft has already signed up for the Fetch Workstream so you have to join the relevant GitHub organization (MicrosoftWHATWGContributors) and make your membership thereof public.

> @@ -6319,6 +6321,24 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Let <var>filteredCoding</var> be "<code>unknown</code>".

Why is this a distinct value from the empty string? It also seems to squat on the value space of the registry, which doesn't seem ideal?

> @@ -6319,6 +6321,24 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Let <var>filteredCoding</var> be "<code>unknown</code>".
+
+         <li><p>If <var>codings</var> is null, set <var>filteredCoding</var> to the empty string.

then set*

> +         <li><p>Otherwise, if <var>codings</var> contains two strings or more, set <var>filteredCoding</var> to
+         "<code>multiple</code>".

then set*

And this should probably compare with Infra's size concept.

> @@ -6319,6 +6321,24 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Let <var>filteredCoding</var> be "<code>unknown</code>".
+
+         <li><p>If <var>codings</var> is null, set <var>filteredCoding</var> to the empty string.
+
+         <li><p>Otherwise, if <var>codings</var> contains two strings or more, set <var>filteredCoding</var> to
+         "<code>multiple</code>".
+
+         <li><p>Otherwise, if <var>codings[0]</var> is the empty string, or it is supported by the user agent,

`<var>codings</var>[0]`*

> @@ -6319,6 +6321,24 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Let <var>filteredCoding</var> be "<code>unknown</code>".
+
+         <li><p>If <var>codings</var> is null, set <var>filteredCoding</var> to the empty string.
+
+         <li><p>Otherwise, if <var>codings</var> contains two strings or more, set <var>filteredCoding</var> to
+         "<code>multiple</code>".
+
+         <li><p>Otherwise, if <var>codings[0]</var> is the empty string, or it is supported by the user agent,
+         and is listed in the <a href="https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding">
+         content encoding registry on IANA</a>, set <var>filteredCoding</var> to <var>codings[0]</var>.

You want `<cite>HTTP Content Coding Registry</cite>` inline and then use a reference for the actual URL.

(And also apply the earlier comments.)

> @@ -6319,6 +6321,24 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
          <li><p>Let <var>codings</var> be the result of <a>extracting header list values</a> given
          `<code>Content-Encoding</code>` and <var>response</var>'s <a for=response>header list</a>.
 
+         <li><p>Let <var>filteredCoding</var> be "<code>unknown</code>".
+
+         <li><p>If <var>codings</var> is null, set <var>filteredCoding</var> to the empty string.
+
+         <li><p>Otherwise, if <var>codings</var> contains two strings or more, set <var>filteredCoding</var> to
+         "<code>multiple</code>".
+
+         <li><p>Otherwise, if <var>codings[0]</var> is the empty string, or it is supported by the user agent,
+         and is listed in the <a href="https://www.iana.org/assignments/http-parameters/http-parameters.xhtml#content-coding">
+         content encoding registry on IANA</a>, set <var>filteredCoding</var> to <var>codings[0]</var>.
+
+         <p class='note'>
+         "<code>identity</code>" is never supported as a coding. See details

This seems bogus? I'm pretty sure we have tests around this value. Also, if we want to make requirements about this value they shouldn't be in a note.

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

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

Received on Wednesday, 9 April 2025 11:35:34 UTC