-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return a content-encoding
header for resource timing and more
#1796
Open
guohuideng2024
wants to merge
4
commits into
whatwg:main
Choose a base branch
from
guohuideng2024:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -370,6 +370,8 @@ following <a for=struct>items</a>: [[RESOURCE-TIMING]] [[NAVIGATION-TIMING]] | |
<dd>A number. | ||
<dt><dfn export for="response body info">content type</dfn> (default the empty string) | ||
<dd>An <a for=/>ASCII string</a>. | ||
<dt><dfn export for="response body info">content encoding</dfn> (default the empty string) | ||
<dd>An <a for=/>ASCII string</a>. | ||
</dl> | ||
|
||
<div algorithm> | ||
|
@@ -1176,6 +1178,7 @@ is a <a>byte-case-insensitive</a> match for one of | |
<li>`<a http-header><code>Access-Control-Request-Headers</code></a>` | ||
<li>`<a http-header><code>Access-Control-Request-Method</code></a>` | ||
<li>`<code>Connection</code>` | ||
<li>`<code>Content-Encoding</code>` | ||
<li>`<code>Content-Length</code>` | ||
<li>`<code>Cookie</code>` | ||
<li>`<code>Cookie2</code>` | ||
|
@@ -3946,6 +3949,40 @@ 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 <var>candidateValue</var>, return failure. | ||
</ol> | ||
|
||
<li><p>If <var>candidateValue</var> is the empty string or has a <a for=/>code point</a> that is | ||
not an <a for=/>ASCII digit</a>, then return null. | ||
|
||
<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> | ||
|
||
|
@@ -5004,6 +5041,13 @@ steps: | |
|
||
<li><p>Let <var>type</var> be <var>blob</var>'s {{Blob/type}}. | ||
|
||
<li><p>Let <var>accept-coding</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, | ||
let <var>coding</var> be the selected encoding option; otherwise, i.e., no encoding is used, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can't have "let" in the middle of a phrase, see style in the rest of the document. |
||
let <var>coding</var> be <a href=https://httpwg.org/specs/rfc9110.html#field.accept-encoding> | ||
<code>"identity"</code></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>`: | ||
|
@@ -5019,7 +5063,9 @@ 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-Type</code>`, <var>type</var>), | ||
(`<code>Content-Encoding</code>`, <var>coding</var>) ». | ||
|
||
</ol> | ||
|
||
<li> | ||
|
@@ -5088,7 +5134,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>) ». | ||
|
||
</ol> | ||
|
||
<li><p>Return <var>response</var>. | ||
|
@@ -5105,10 +5152,19 @@ steps: | |
<li><p>Let <var>mimeType</var> be <var>dataURLStruct</var>'s | ||
<a for="data: URL struct">MIME type</a>, <a lt="serialize a MIME type to bytes">serialized</a>. | ||
|
||
<li><p>Let <var>accept-coding</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>. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wrong indentation |
||
If <var>accept-encoding</var> is not null and the server selects one of the encoding options, | ||
let <var>coding</var> be the selected encoding option; otherwise, i.e., no encoding is used, | ||
let <var>coding</var> be <a href=https://httpwg.org/specs/rfc9110.html#field.accept-encoding> | ||
<code>"identity"</code></a>. | ||
|
||
<li><p>Return a new <a for=/>response</a> whose <a for=response>status message</a> is | ||
`<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>. | ||
<var>mimeType</var>), (`<code>Content-Encoding</code>`, <var>coding</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>. | ||
|
||
</ol> | ||
|
||
<dt>"<code>file</code>" | ||
|
@@ -9127,6 +9183,7 @@ Gavin Carothers, | |
Glenn Maynard, | ||
Graham Klyne, | ||
Gregory Terzian, | ||
Guohui Deng(邓国辉)<!-- guohuideng2024; GitHub -->, | ||
Hal Lockhart, | ||
Hallvord R. M. Steen, | ||
Harris Hancock, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong indentation