Skip to content

Commit

Permalink
Simply
Browse files Browse the repository at this point in the history
Just add the content encoding to body info.
  • Loading branch information
Guohui Deng committed Jan 22, 2025
1 parent 46c10a9 commit a963008
Showing 1 changed file with 5 additions and 40 deletions.
45 changes: 5 additions & 40 deletions fetch.bs
Original file line number Diff line number Diff line change
Expand Up @@ -3948,39 +3948,6 @@ Content-Type:
</div>
</div>

<h3 id=content-encoding>`<code>Content-Encoding</code>` header</h3>

<p>The `<code>Content-Encoding</code>` header is largely defined in HTTP. Its processing model is
defined here as the model defined in HTTP is not compatible with web content. [[HTTP]]

<div algorithm>
<p>To <dfn export for="header list" lt="extract an encoding type|extracting an encoding type">
extract an encoding type</dfn> from a <a for=/>header list</a> <var>headers</var>, run these steps:

<ol>
<li><p>Let <var>values</var> be the result of
<a for="header list">getting, decoding, and splitting</a> `<code>Content-Encoding</code>` from
<var>headers</var>.

<li><p>If <var>values</var> is null, then return null.

<li><p>Let <var>candidateValue</var> be null.

<li>
<p><a for=list>For each</a> <var>value</var> of <var>values</var>:

<ol>
<li><p>If <var>candidateValue</var> is null, then set <var>candidateValue</var> to
<var>value</var>.

<li><p>Otherwise, if <var>value</var> is not an <a>ASCII case-insensitive</a> match for
<var>candidateValue</var>, return failure.
</ol>

<li><p>Return <var>candidateValue</var>, interpreted as a string.
</ol>
</div>

<h3 id=x-content-type-options-header>`<code>X-Content-Type-Options</code>` header</h3>

<p>The
Expand Down Expand Up @@ -5043,9 +5010,6 @@ steps:

<li><p>Let <var>type</var> be <var>blob</var>'s {{Blob/type}}.

<li><p>Let <var>contentEncoding</var> be the result of <a for="header list">getting</a>
`<code>Content-Encoding</code>` from <var>request</var>'s <a for=request>header list</a>.

<li>
<p>If <var>request</var>'s <a for=request>header list</a>
<a for="header list">does not contain</a> `<code>Range</code>`:
Expand All @@ -5061,9 +5025,7 @@ steps:

<li><p>Set <var>response</var>'s <a for=response>header list</a> to «
(`<code>Content-Length</code>`, <var>serializedFullLength</var>),
(`<code>Content-Type</code>`, <var>type</var>),
(`<code>Content-Encoding</code>`, <var>contentEncoding</var>) ».

(`<code>Content-Type</code>`, <var>type</var>) ».
</ol>

<li>
Expand Down Expand Up @@ -5132,7 +5094,7 @@ 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>), (`<code>Content-Encoding</code>`, <var>contentEncoding</var>) ».
<var>contentRange</var>) ».
</ol>

<li><p>Return <var>response</var>.
Expand Down Expand Up @@ -6359,6 +6321,9 @@ 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>Set <var>response</var>'s <a for=response>body info</a>'s
<a for="response body info">content encoding</a> to <var>codings</var>.

<li><p>Increase <var>response</var>'s <a for=response>body info</a>'s
<a for="response body info">encoded size</a> by <var>bytes</var>'s
<a for="byte sequence">length</a>.
Expand Down

0 comments on commit a963008

Please sign in to comment.