|
7 | 7 |
|
8 | 8 | <p><a class="logo" href="https://whatwg.org/"><img alt="WHATWG" height="100" src="https://resources.whatwg.org/logo-fetch.svg" width="100"></a>
|
9 | 9 | <h1 id="cors">Fetch</h1>
|
10 |
| -<h2 class="no-num no-toc" id="living-standard-—-last-updated-5-april-2016">Living Standard — Last Updated 5 April 2016</h2> |
| 10 | +<h2 class="no-num no-toc" id="living-standard-—-last-updated-10-april-2016">Living Standard — Last Updated 10 April 2016</h2> |
11 | 11 |
|
12 | 12 | <dl>
|
13 | 13 | <dt>Participate:
|
@@ -60,9 +60,10 @@ <h2 class="no-num no-toc" id="table-of-contents">Table of Contents</h2>
|
60 | 60 | <li><a href="#should-response-to-request-be-blocked-due-to-mime-type?"><span class="secno">3.6 </span>Should
|
61 | 61 | <var>response</var> to <var>request</var> be blocked due to its MIME type?</a></li>
|
62 | 62 | <li><a href="#referrer-policies"><span class="secno">3.7 </span>Referrer policies</a></li>
|
63 |
| - <li><a href="#streams"><span class="secno">3.8 </span>Streams</a> |
| 63 | + <li><a href="#client-hints-list"><span class="secno">3.8 </span>Client hints list</a></li> |
| 64 | + <li><a href="#streams"><span class="secno">3.9 </span>Streams</a> |
64 | 65 | <ol>
|
65 |
| - <li><a href="#readablestream"><span class="secno">3.8.1 </span>ReadableStream</a></ol></ol></li> |
| 66 | + <li><a href="#readablestream"><span class="secno">3.9.1 </span>ReadableStream</a></ol></ol></li> |
66 | 67 | <li><a href="#http-extensions"><span class="secno">4 </span>HTTP extensions</a>
|
67 | 68 | <ol>
|
68 | 69 | <li><a href="#origin-header"><span class="secno">4.1 </span>`<code title="">Origin</code>` header</a></li>
|
@@ -393,17 +394,35 @@ <h4 id="terminology-headers"><span class="secno">3.1.2 </span>Headers</h4>
|
393 | 394 | <hr>
|
394 | 395 |
|
395 | 396 | <p>A <dfn id="simple-header">simple header</dfn> is a <a href="#concept-header" title="concept-header">header</a> whose
|
396 |
| -<a href="#concept-header-name" title="concept-header-name">name</a> is `<code title="">Accept</code>`, |
397 |
| -`<code title="">Accept-Language</code>`, or `<code title="">Content-Language</code>`, or whose |
398 |
| -<a href="#concept-header-name" title="concept-header-name">name</a> is `<code title="">Content-Type</code>` and |
399 |
| -<a href="#concept-header-value" title="concept-header-value">value</a>, <a href="#concept-header-parse" title="concept-header-parse">once parsed</a>, |
400 |
| -has a MIME type (ignoring parameters) that is |
401 |
| -`<code title="">application/x-www-form-urlencoded</code>`, `<code title="">multipart/form-data</code>`, or |
402 |
| -`<code title="">text/plain</code>`. |
| 397 | +<a href="#concept-header-name" title="concept-header-name">name</a> is one of |
| 398 | + |
| 399 | +<ul class="brief"> |
| 400 | + <li>`<code title="">Accept</code>` |
| 401 | + <li>`<code title="">Accept-Language</code>` |
| 402 | + <li>`<code title="">Content-Language</code>` |
| 403 | + <li>`<code title="">Content-Type</code>` and whose <a href="#concept-header-value" title="concept-header-value">value</a>, |
| 404 | + <a href="#concept-header-parse" title="concept-header-parse">once parsed</a>, has a MIME type (ignoring parameters) |
| 405 | + that is `<code title="">application/x-www-form-urlencoded</code>`, |
| 406 | + `<code title="">multipart/form-data</code>`, or `<code title="">text/plain</code>` |
| 407 | +</ul> |
| 408 | + |
403 | 409 | <!-- XXX * needs better xref
|
404 | 410 | * ignoring parameters has been the standard for a long time now
|
405 | 411 | * interesting test: "Content-Type: text/plain;" -->
|
406 | 412 |
|
| 413 | +<p>or whose <a href="#concept-header-name" title="concept-header-name">name</a> is one of |
| 414 | + |
| 415 | +<ul class="brief"> |
| 416 | + <li>`<code title=""><a href="http://httpwg.org/http-extensions/client-hints.html#dpr">DPR</a></code>` |
| 417 | + <li>`<code title=""><a href="http://httpwg.org/http-extensions/client-hints.html#downlink">Downlink</a></code>` |
| 418 | + <li>`<code title=""><a href="http://httpwg.org/http-extensions/client-hints.html#save-data">Save-Data</a></code>` |
| 419 | + <li>`<code title=""><a href="http://httpwg.org/http-extensions/client-hints.html#viewport-width">Viewport-Width</a></code>` |
| 420 | + <li>`<code title=""><a href="http://httpwg.org/http-extensions/client-hints.html#width">Width</a></code>` |
| 421 | +</ul> |
| 422 | + |
| 423 | +<p>and whose <a href="#concept-header-value" title="concept-header-value">value</a>, |
| 424 | +<a href="#concept-header-parse" title="concept-header-parse">once parsed</a>, is not a failure. |
| 425 | + |
407 | 426 | <p>A <dfn id="forbidden-header-name">forbidden header name</dfn> is a <a href="#concept-header" title="concept-header">header</a>
|
408 | 427 | <a href="#concept-header-name" title="concept-header-name">name</a> that is one of
|
409 | 428 |
|
@@ -873,6 +892,15 @@ <h4 id="requests"><span class="secno">3.1.5 </span>Requests</h4>
|
873 | 892 | an <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>.
|
874 | 893 | <a href="#refsREFERRER">[REFERRER]</a>
|
875 | 894 |
|
| 895 | +<p>A <a href="#concept-request" title="concept-request">request</a> has an associated |
| 896 | +<dfn id="concept-request-client-hints-list" title="concept-request-client-hints-list">client hints list</dfn>, which is a |
| 897 | +<a href="#concept-client-hints-list" title="concept-client-hints-list">client-hints list</a>. Unless stated otherwise, it is |
| 898 | +the empty list. |
| 899 | + |
| 900 | +<p class="note no-backref">This will be used to override a client hints list associated with |
| 901 | +an <a class="external" data-anolis-spec="html" href="https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object">environment settings object</a>. |
| 902 | +<a href="#refsCLIENT-HINTS">[CLIENT-HINTS]</a> |
| 903 | + |
876 | 904 | <p>A <a href="#concept-request" title="concept-request">request</a> has an associated
|
877 | 905 | <dfn id="synchronous-flag">synchronous flag</dfn>. Unless stated otherwise it is unset.
|
878 | 906 |
|
@@ -1456,11 +1484,24 @@ <h3 id="referrer-policies"><span class="secno">3.7 </span>Referrer policies</h3>
|
1456 | 1484 | <a href="#refsREFERRER">[REFERRER]</a>
|
1457 | 1485 |
|
1458 | 1486 |
|
1459 |
| -<h3 id="streams"><span class="secno">3.8 </span>Streams</h3> |
| 1487 | +<h3 id="client-hints-list"><span class="secno">3.8 </span>Client hints list</h3> |
| 1488 | + |
| 1489 | +<p class="note">This section will be integrated into HTTP Client Hints. |
| 1490 | +<a href="#refsCLIENT-HINTS">[CLIENT-HINTS]</a> |
| 1491 | +<!-- XXX --> |
| 1492 | + |
| 1493 | +<p>A <dfn id="concept-client-hints-list" title="concept-client-hints-list">client hints list</dfn> is a list of |
| 1494 | +<a href="http://httpwg.org/http-extensions/client-hints.html#accept-ch">Client hint tokens</a>, |
| 1495 | +each of which is one of `<code title="">dpr</code>`, |
| 1496 | +`<code title="">save-data</code>`, `<code title="">viewport-width</code>`, or |
| 1497 | +`<code title="">width</code>`. |
| 1498 | + |
| 1499 | + |
| 1500 | +<h3 id="streams"><span class="secno">3.9 </span>Streams</h3> |
1460 | 1501 |
|
1461 | 1502 | <p class="note no-backref">This section might be integrated into other standards, such as IDL.
|
1462 | 1503 |
|
1463 |
| -<h4 id="readablestream"><span class="secno">3.8.1 </span>ReadableStream</h4> |
| 1504 | +<h4 id="readablestream"><span class="secno">3.9.1 </span>ReadableStream</h4> |
1464 | 1505 |
|
1465 | 1506 | <p>A <dfn id="concept-readablestream" title="concept-ReadableStream">ReadableStream</dfn> object represents a
|
1466 | 1507 | <a class="external" data-anolis-spec="streams" href="https://streams.spec.whatwg.org/#rs-class" title="readablestream">stream of data</a>. In this section, we
|
@@ -1957,10 +1998,60 @@ <h2 id="fetching"><span class="secno">5 </span>Fetching</h2>
|
1957 | 1998 | for HTTP/2, and equivalent information used to prioritize dispatch and processing of
|
1958 | 1999 | HTTP/1 fetches.
|
1959 | 2000 |
|
| 2001 | + |
| 2002 | + <li> |
| 2003 | + <p>If <var>request</var> is a <a href="#navigation-request">navigation request</a>, a user agent should, for each |
| 2004 | + <a href="#concept-header" title="concept-header">header</a> <a href="#concept-header-name" title="concept-header-name">name</a> |
| 2005 | + (<var>hint-name</var>) in the first column of the following table, if <var>hint-name</var> |
| 2006 | + is not in <var>request</var>'s <a href="#concept-request-header-list" title="concept-request-header-list">header list</a>, |
| 2007 | + <a href="#concept-header-list-append" title="concept-header-list-append">append</a> |
| 2008 | + <var>hint-name</var>/<var>hint-value</var> given in the same row on the second column, to |
| 2009 | + <var>request</var>'s <a href="#concept-request-header-list" title="concept-request-header-list">header list</a>. |
| 2010 | + |
| 2011 | + <table> |
| 2012 | + <tr> |
| 2013 | + <th><span title="hint-name">hint-name</span> |
| 2014 | + <th><span title="hint-value">hint-value</span> |
| 2015 | + <tr> |
| 2016 | + <td>`<code title="http-dpr">dpr</code>` |
| 2017 | + <td>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#dpr">dpr value</a> |
| 2018 | + <tr> |
| 2019 | + <td>`<code title="http-save-data">save-data</code>` |
| 2020 | + <td>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#save-data">save-data value</a> |
| 2021 | + <tr> |
| 2022 | + <td>`<code title="http-viewport-width">viewport-width</code>` |
| 2023 | + <td>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#viewport-width">viewport-width value</a> |
| 2024 | + </table> |
| 2025 | + |
1960 | 2026 | <li>
|
1961 | 2027 | <p>If <var>request</var> is a <a href="#subresource-request">subresource request</a>, run these substeps:
|
1962 | 2028 |
|
1963 | 2029 | <ol>
|
| 2030 | + <li> |
| 2031 | + <p>If the <var>request</var>'s <span title="concept-client-hint-list">client hints list</span> is |
| 2032 | + not empty, then run these substeps for each <var>hint-name</var> in the list: |
| 2033 | + |
| 2034 | + <ol> |
| 2035 | + <li> |
| 2036 | + <p>Set <var>value</var> to the first matching statement, if any, switching on |
| 2037 | + <var>hint-name</var>: |
| 2038 | + |
| 2039 | + <dl class="switch"> |
| 2040 | + <dt>"<code title="">dpr</code>" |
| 2041 | + <dd>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#dpr">dpr value</a> |
| 2042 | + <dt>"<code title="">save-data</code>" |
| 2043 | + <dd>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#save-data">save-data value</a> |
| 2044 | + <dt>"<code title="">viewport-width</code>" |
| 2045 | + <dd>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#viewport-width">viewport-width value</a> |
| 2046 | + <dt>"<code title="">width</code>" |
| 2047 | + <dd>a suitable <a href="http://httpwg.org/http-extensions/client-hints.html#width">width value</a> |
| 2048 | + </dl> |
| 2049 | + |
| 2050 | + <li><p><a href="#concept-header-list-append" title="concept-header-list-append">Append</a> |
| 2051 | + <var>hint-name</var>/<var>value</var> to <var>request</var>'s |
| 2052 | + <a href="#concept-request-header-list" title="concept-request-header-list">header list</a>. |
| 2053 | + </ol> |
| 2054 | + |
1964 | 2055 | <li><p>Let <var>record</var> be a new
|
1965 | 2056 | <a href="#concept-fetch-record" title="concept-fetch-record">fetch record</a> consisting of
|
1966 | 2057 | <var>request</var> and this instance of the
|
@@ -5074,6 +5165,9 @@ <h2 class="no-num" id="references">References</h2>
|
5074 | 5165 | <div id="anolis-references"><dl><dt id="refsABNF">[ABNF]
|
5075 | 5166 | <dd><cite><a href="http://tools.ietf.org/html/rfc5234">Augmented BNF for Syntax Specifications: ABNF</a></cite>, D. Crocker and P. Overell. IETF.
|
5076 | 5167 |
|
| 5168 | +<dt id="refsCLIENT-HINTS">[CLIENT-HINTS] |
| 5169 | +<dd><cite><a href="https://tools.ietf.org/html/draft-ietf-httpbis-client-hints">HTTP Client Hints</a></cite>, Ilya Grigorik. IETF. |
| 5170 | + |
5077 | 5171 | <dt id="refsCOOKIES">[COOKIES]
|
5078 | 5172 | <dd><cite><a href="https://tools.ietf.org/html/rfc6265">HTTP State Management Mechanism</a></cite>, Adam Barth. IETF.
|
5079 | 5173 |
|
|
0 commit comments