Skip to content

Commit 931cd06

Browse files
abinpaul1annevk
andauthored
Expose a minimized Content-Type to Resource Timing
This defines the content type field as a minimized version of the response's parsed Content-Type header, to give web developers enough information to distinguish responses, but not enough to make it an additional communication channel. This feature will be used by Resource Timing as per w3c/resource-timing#341. Co-authored-by: Anne van Kesteren <[email protected]>
1 parent 76ee5f5 commit 931cd06

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

fetch.bs

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,13 @@ information needed by <cite>Resource Timing</cite> and <cite>Navigation Timing</
362362
following <a for=struct>items</a>: [[RESOURCE-TIMING]] [[NAVIGATION-TIMING]]
363363

364364
<dl>
365-
<dt><dfn export for="response body info" id="fetch-timing-info-encoded-body-size">encoded
366-
size</dfn> (default 0)
367-
<dt><dfn export for="response body info" id="fetch-timing-info-decoded-body-size">decoded
368-
size</dfn> (default 0)
365+
<dt><dfn export for="response body info" id="fetch-timing-info-encoded-body-size">encoded size</dfn>
366+
(default 0)
367+
<dt><dfn export for="response body info" id="fetch-timing-info-decoded-body-size">decoded size</dfn>
368+
(default 0)
369369
<dd>A number.
370+
<dt><dfn export for="response body info">content type</dfn> (default the empty string)
371+
<dd>An <a for=/>ASCII string</a>.
370372
</dl>
371373

372374
<div algorithm>
@@ -4755,6 +4757,21 @@ steps:
47554757
<var>response</var>'s <a for=response>has-cross-origin-redirects</a> is true; otherwise
47564758
<var>response</var>'s <a for=response>status</a>.
47574759

4760+
<li>
4761+
<p>If <var>fetchParams</var>'s <a for="fetch params">request</a>'s <a for=request>mode</a> is
4762+
not "<code>navigate</code>" or <var>response</var>'s
4763+
<a for=response>has-cross-origin-redirects</a> is false:
4764+
4765+
<ol>
4766+
<li><p>Let <var>mimeType</var> be the result of
4767+
<a for="header list">extracting a MIME type</a> from <var>response</var>'s
4768+
<a for=response>header list</a>.
4769+
4770+
<li><p>If <var>mimeType</var> is non-null, then set <var>bodyInfo</var>'s
4771+
<a for="response body info">content type</a> to the result of
4772+
<a>minimizing a supported MIME type</a> given <var>mimeType</var>.
4773+
</ol>
4774+
47584775
<li><p>If <var>fetchParams</var>'s <a for="fetch params">request</a>'s
47594776
<a for=request>initiator type</a> is non-null, then <a for=/>mark resource timing</a> given
47604777
<var>timingInfo</var>, <var>fetchParams</var>'s <a for="fetch params">request</a>'s

0 commit comments

Comments
 (0)