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

@noamr commented on this pull request.



> @@ -5113,6 +5160,7 @@ steps:
      `<code>OK</code>`, <a for=response>header list</a> is « (`<code>Content-Type</code>`,
      <var>mimeType</var>) », and <a for=response>body</a> is <var>dataURLStruct</var>'s
      <a for="data: URL struct">body</a> <a for="byte sequence">as a body</a>.
+

Spurious

> @@ -5092,7 +5138,8 @@ steps:
        <li><p>Set <var>response</var>'s <a for=response>header list</a> to «
        (`<code>Content-Length</code>`, <var>serializedSlicedLength</var>),
        (`<code>Content-Type</code>`, <var>type</var>), (`<code>Content-Range</code>`,
-       <var>contentRange</var>) ».
+       <var>contentRange</var>), (`<code>Content-Encoding</code>`, <var>coding</var>) ».
+

Remove new line

> @@ -5008,6 +5043,15 @@ steps:
 
      <li><p>Let <var>type</var> be <var>blob</var>'s {{Blob/type}}.
 
+     <li><p>Let <var>coding</var> be the empty string.

Maybe call it `contentEncoding`?

> @@ -5008,6 +5043,15 @@ steps:
 
      <li><p>Let <var>type</var> be <var>blob</var>'s {{Blob/type}}.
 
+     <li><p>Let <var>coding</var> be the empty string.
+
+     <li><p>Let <var>accept-encoding</var> be the result of <a for="header list">getting</a>
+     `<code>Accept-Encoding</code>` from <var>request</var>'s <a for=request>header list</a>.
+     If <var>accept-encoding</var> is not null and the server selects one of the encoding options,
+     set <var>coding</var> to the selected encoding option; otherwise, i.e., no encoding is used,
+     set <var>coding</var> to <a href=https://httpwg.org/specs/rfc9110.html#field.accept-encoding>

Perhaps set it to `identity` by default instead of an empty string, and only set it if the value exists in the header?

Also "If <var>accept-encoding</var> is not null and the server selects one of the encoding options" doesn't sound normative. What does it mean for the server to select? Is it anything different from `accept-encoding` being non-null?

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

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

Received on Wednesday, 22 January 2025 12:10:05 UTC