Skip to content

Commit 4500d3a

Browse files
authored
Editorial: account for HTTP updates
Fixes #1558.
1 parent f844d5c commit 4500d3a

File tree

1 file changed

+65
-67
lines changed

1 file changed

+65
-67
lines changed

fetch.bs

Lines changed: 65 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,32 @@ Translate IDs: typedefdef-bodyinit bodyinit,dictdef-requestinit requestinit,type
1111
</pre>
1212

1313
<pre class=anchors>
14-
urlPrefix:https://datatracker.ietf.org/doc/html/rfc7230#;type:dfn;spec:http
15-
url:section-3.1.1;text:method
16-
url:section-3.2;text:field-name
17-
url:section-3.2;text:field-content
18-
url:section-3.2;text:field-value
19-
url:section-3.1.2;text:reason-phrase
20-
21-
url:https://datatracker.ietf.org/doc/html/rfc7234#section-1.2.1;text:delta-seconds;type:dfn;spec:http-caching
22-
23-
urlPrefix:https://datatracker.ietf.org/doc/html/rfc8941#;type:dfn;spec:rfc8941
24-
url:section-2;text:structured field value
25-
url:section-4.1;text:serializing structured fields
26-
url:section-4.2;text:parsing structured fields
14+
urlPrefix:https://httpwg.org/specs/rfc5861.html#;type:dfn;spec:stale-while-revalidate
15+
url:n-the-stale-while-revalidate-cache-control-extension;text:stale-while-revalidate lifetime
16+
17+
urlPrefix:https://httpwg.org/specs/rfc8941.html#;type:dfn;spec:rfc8941
18+
url:rfc.section.2;text:structured field value
19+
url:text-serialize;text:serializing structured fields
20+
url:text-parse;text:parsing structured fields
21+
22+
urlPrefix:https://httpwg.org/specs/rfc9110.html#;type:dfn;spec:http
23+
url:method.overview;text:method
24+
url:fields.names;text:field-name
25+
url:fields.values;text:field-value
26+
url:rfc.section.9.2.1;text:unsafe
27+
28+
urlPrefix:https://httpwg.org/specs/rfc9111.html#;type:dfn;spec:http-caching
29+
url:delta-seconds;text:delta-seconds
30+
url:age.calculations;text:current age
31+
url:calculating.freshness.lifetime;text:freshness lifetime
32+
url:response.cacheability;text:Storing Responses in Caches
33+
url:invalidation;text:Invalidating Stored Responses
34+
url:validation.sent;text:Sending a Validation Request
35+
url:constructing.responses.from.caches;text:Constructing Responses from Caches
36+
url:freshening.responses;text:Freshening Stored Responses upon Validation
37+
38+
urlPrefix:https://httpwg.org/specs/rfc9112.html#;type:dfn;spec:http1
39+
url:status.line;text:reason-phrase
2740

2841
url:https://w3c.github.io/resource-timing/#dfn-mark-resource-timing;text:mark resource timing;type:dfn;spec:resource-timing
2942

@@ -50,6 +63,12 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
5063
"HTTP1": {
5164
"aliasOf": "RFC9112"
5265
},
66+
"HTTP3": {
67+
"aliasOf": "RFC9114"
68+
},
69+
"HTTP3-DATAGRAM": {
70+
"aliasOf": "RFC9297"
71+
},
5372
"REFERRER": {
5473
"aliasOf": "referrer-policy"
5574
},
@@ -77,33 +96,12 @@ urlPrefix:https://tc39.es/ecma262/#;type:dfn;spec:ecma-262
7796
"href": "https://www.kb.cert.org/vuls/id/150227",
7897
"title": "HTTP proxy default configurations allow arbitrary TCP connections."
7998
},
80-
"EXPECT-CT": {
81-
"authors": ["Emily Stark"],
82-
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-expect-ct",
83-
"publisher": "IETF",
84-
"title": "Expect-CT Extension for HTTP"
85-
},
86-
"OCSP": {
87-
"aliasOf": "RFC2560"
88-
},
89-
"HTTP3": {
90-
"authors": ["M. Bishop, Ed."],
91-
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-quic-http",
92-
"publisher": "IETF",
93-
"title": "Hypertext Transfer Protocol Version 3 (HTTP/3)"
94-
},
9599
"WEBTRANSPORT-HTTP3": {
96100
"authors": ["V. Vasiliev"],
97101
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-webtrans-http3",
98102
"publisher": "IETF",
99103
"title": "WebTransport over HTTP/3"
100104
},
101-
"HTTP3-DATAGRAM": {
102-
"authors": ["David Schinazi", "Lucas Pardue"],
103-
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-masque-h3-datagram",
104-
"publisher": "IETF",
105-
"title": "Using QUIC Datagrams with HTTP/3"
106-
},
107105
"SVCB": {
108106
"authors": ["Ben Schwartz", "Mike Bishop", "Erik Nygren"],
109107
"href": "https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https",
@@ -564,6 +562,10 @@ consistency.
564562

565563
<h4 id=terminology-headers>Headers</h4>
566564

565+
<p class=note>HTTP generally refers to a header as a "field" or "header field". The web platform
566+
uses the more colloquial term "header". [[HTTP]]
567+
<!-- This will become more hairy if we add trailer support. -->
568+
567569
<p>A <dfn export id=concept-header-list>header list</dfn> is a <a for=/>list</a> of zero or more
568570
<a for=/>headers</a>. It is initially « ».
569571

@@ -916,9 +918,9 @@ conditions:
916918
<li><p>Contains no 0x00 (NUL) or <a>HTTP newline bytes</a>.
917919
</ul>
918920

919-
<p class=note>The definition of <a for=/>header value</a> is not defined in terms of an HTTP token
920-
production as
921-
<a href=https://github.com/httpwg/http11bis/issues/19 title="fix field-value ABNF">it is broken</a>.
921+
<p class=note>The definition of <a for=/>header value</a> is not defined in terms of the
922+
<a spec=http>field-value</a> token production as it is
923+
<a href=https://github.com/httpwg/http-core/issues/215 title="field-value value space">not compatible with deployed content</a>.
922924

923925
<div algorithm>
924926
<p>To <dfn export for="header value" id=concept-header-value-normalize>normalize</dfn> a
@@ -1023,7 +1025,7 @@ following is true:
10231025
<li><p><var>byte</var> is 0x22 ("), 0x28 (left parenthesis), 0x29 (right parenthesis), 0x3A (:),
10241026
0x3C (&lt;), 0x3E (>), 0x3F (?), 0x40 (@), 0x5B ([), 0x5C (\), 0x5D (]), 0x7B ({), 0x7D (}), or
10251027
0x7F DEL.
1026-
<!-- Delimiters from https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6 except for ,/;=
1028+
<!-- Delimiters from https://httpwg.org/specs/rfc9110.html#rule.token.separators except for ,/;=
10271029
and including DEL -->
10281030
</ul>
10291031
</div>
@@ -2534,13 +2536,11 @@ console.log((await fetch("/surprise-me", { redirect: "manual" })).type); // "opa
25342536
<hr>
25352537

25362538
<p>A <dfn id=concept-fresh-response>fresh response</dfn> is a <a for=/>response</a> whose
2537-
<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.2.3>current age</a> is within its
2538-
<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.2.1>freshness lifetime</a>.
2539+
<a>current age</a> is within its <a>freshness lifetime</a>.
25392540

25402541
<p>A <dfn id=concept-stale-while-revalidate-response>stale-while-revalidate response</dfn> is a
2541-
<a for=/>response</a> that is not a <a>fresh response</a> and whose
2542-
<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.2.3>current age</a> is within the
2543-
<a href=https://datatracker.ietf.org/doc/html/rfc5861#section-3>stale-while-revalidate lifetime</a>.
2542+
<a for=/>response</a> that is not a <a>fresh response</a> and whose <a>current age</a> is within the
2543+
<a>stale-while-revalidate lifetime</a>. [[!HTTP-CACHING]] [[!STALE-WHILE-REVALIDATE]]
25442544

25452545
<p>A <dfn export id=concept-stale-response>stale response</dfn> is a <a for=/>response</a> that is
25462546
not a <a>fresh response</a> or a <a>stale-while-revalidate response</a>.
@@ -3629,9 +3629,9 @@ values:
36293629

36303630
<ul class=brief>
36313631
<li>`<code>application/csp-report</code>` [[CSP]]
3632-
<li>`<code>application/expect-ct-report+json</code>` [[EXPECT-CT]]
3632+
<li>`<code>application/expect-ct-report+json</code>` [[RFC9163]]
36333633
<li>`<code>application/xss-auditor-report</code>`
3634-
<li>`<code>application/ocsp-request</code>` [[OCSP]]
3634+
<li>`<code>application/ocsp-request</code>` [[RFC6960]]
36353635
</ul>
36363636

36373637
<p>Specifications should avoid introducing new exceptions and should only do so with careful
@@ -4361,13 +4361,13 @@ steps:
43614361
<li><var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a> is a
43624362
<a for=/>domain</a>
43634363
<li>Matching <var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a> per
4364-
<a href=https://datatracker.ietf.org/doc/html/rfc6797#section-8.2>Known HSTS Host Domain Name Matching</a>
4364+
<a href=https://www.rfc-editor.org/rfc/rfc6797.html#section-8.2>Known HSTS Host Domain Name Matching</a>
43654365
results in either a superdomain match with an asserted <code>includeSubDomains</code> directive
43664366
or a congruent match (with or without an asserted <code>includeSubDomains</code> directive) [[!HSTS]]; or
43674367
DNS resolution for the request finds a matching HTTPS RR per
43684368
<a href=https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https#section-9.5>section 9.5</a>
43694369
of [[!SVCB]].
4370-
[[!HSTS]][[!SVCB]]
4370+
[[!HSTS]] [[!SVCB]]
43714371
</ul>
43724372
<!-- Per Mike West HSTS happens "probably after" Referrer -->
43734373

@@ -5395,12 +5395,12 @@ run these steps:
53955395
<ol>
53965396
<li>
53975397
<p>If the user agent is not configured to block cookies for <var>httpRequest</var> (see
5398-
<a href=https://datatracker.ietf.org/doc/html/rfc6265#section-7>section 7</a> of
5398+
<a href=https://httpwg.org/specs/rfc6265.html#privacy-considerations>section 7</a> of
53995399
[[!COOKIES]]), then:
54005400

54015401
<ol>
54025402
<li><p>Let <var>cookies</var> be the result of running the "cookie-string" algorithm (see
5403-
<a href=https://datatracker.ietf.org/doc/html/rfc6265#section-5.4>section 5.4</a> of
5403+
<a href=https://httpwg.org/specs/rfc6265.html#cookie>section 5.4</a> of
54045404
[[!COOKIES]]) with the user agent's cookie store and <var>httpRequest</var>'s
54055405
<a for=request>current URL</a>.
54065406

@@ -5454,8 +5454,8 @@ run these steps:
54545454
<li>
54555455
<p>Set <var>storedResponse</var> to the result of selecting a response from the
54565456
<var>httpCache</var>, possibly needing validation, as per the
5457-
"<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4>Constructing Responses from Caches</a>"
5458-
chapter of <cite>HTTP Caching</cite> [[!HTTP-CACHING]], if any.
5457+
"<a>Constructing Responses from Caches</a>" chapter of <cite>HTTP Caching</cite>, if any.
5458+
[[!HTTP-CACHING]]
54595459

54605460
<p class=note>As mandated by HTTP, this still takes the `<code>Vary</code>`
54615461
<a for=/>header</a> into account.
@@ -5522,9 +5522,8 @@ run these steps:
55225522
<a for=request>header list</a>.
55235523
</ol>
55245524

5525-
<p class=note>See also the
5526-
"<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.3.4>Sending a Validation Request</a>"
5527-
chapter of <cite>HTTP Caching</cite> [[!HTTP-CACHING]].
5525+
<p class=note>See also the "<a>Sending a Validation Request</a>" chapter of
5526+
<cite>HTTP Caching</cite>. [[!HTTP-CACHING]]
55285527

55295528
<li><p>Otherwise, set <var>response</var> to <var>storedResponse</var> and set
55305529
<var>response</var>'s <a for=response>cache state</a> to "<code>local</code>".
@@ -5548,12 +5547,11 @@ run these steps:
55485547
<li><p>Let <var>forwardResponse</var> be the result of running <a>HTTP-network fetch</a> given
55495548
<var>httpFetchParams</var>, <var>includeCredentials</var>, and <var>isNewConnectionFetch</var>.
55505549

5551-
<li><p>If <var>httpRequest</var>'s <a for=request>method</a> is
5552-
<a href=https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.1>unsafe</a> and
5550+
<li><p>If <var>httpRequest</var>'s <a for=request>method</a> is <a>unsafe</a> and
55535551
<var>forwardResponse</var>'s <a for=response>status</a> is in the range 200 to 399, inclusive,
55545552
invalidate appropriate stored responses in <var>httpCache</var>, as per the
5555-
"<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.4>Invalidation</a>" chapter of
5556-
<cite>HTTP Caching</cite>, and set <var>storedResponse</var> to null. [[!HTTP-CACHING]]
5553+
"<a>Invalidating Stored Responses</a>" chapter of <cite>HTTP Caching</cite>, and set
5554+
<var>storedResponse</var> to null. [[!HTTP-CACHING]]
55575555

55585556
<li>
55595557
<p>If the <var>revalidatingFlag</var> is set and <var>forwardResponse</var>'s
@@ -5563,8 +5561,8 @@ run these steps:
55635561
<li>
55645562
<p>Update <var>storedResponse</var>'s <a for=response>header list</a> using
55655563
<var>forwardResponse</var>'s <a for=response>header list</a>, as per the
5566-
"<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-4.3.4>Freshening Stored Responses upon Validation</a>"
5567-
chapter of <cite>HTTP Caching</cite>. [[!HTTP-CACHING]]
5564+
"<a>Freshening Stored Responses upon Validation</a>" chapter of <cite>HTTP Caching</cite>.
5565+
[[!HTTP-CACHING]]
55685566

55695567
<p class="note">This updates the stored response in cache as well.
55705568

@@ -5581,8 +5579,8 @@ run these steps:
55815579

55825580
<li>
55835581
<p>Store <var>httpRequest</var> and <var>forwardResponse</var> in <var>httpCache</var>, as per
5584-
the "<a href=https://datatracker.ietf.org/doc/html/rfc7234#section-3>Storing Responses in Caches</a>"
5585-
chapter of <cite>HTTP Caching</cite>. [[!HTTP-CACHING]]
5582+
the "<a>Storing Responses in Caches</a>" chapter of <cite>HTTP Caching</cite>.
5583+
[[!HTTP-CACHING]]
55865584

55875585
<p class=note>If <var>forwardResponse</var> is a <a>network error</a>, this effectively caches
55885586
the network error, which is sometimes known as "negative caching".
@@ -5941,10 +5939,10 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
59415939

59425940
<li><p tracking-vector>If <var>includeCredentials</var> is true and the user agent is not
59435941
configured to block cookies for <var>request</var> (see
5944-
<a href=https://datatracker.ietf.org/doc/html/rfc6265#section-7>section 7</a> of [[!COOKIES]]),
5945-
then run the "set-cookie-string" parsing algorithm (see
5946-
<a href=https://datatracker.ietf.org/doc/html/rfc6265#section-5.2>section 5.2</a> of [[!COOKIES]])
5947-
on the <a for=header>value</a> of each <var>header</var> whose <a for=header>name</a> is a
5942+
<a href=https://httpwg.org/specs/rfc6265.html#privacy-considerations>section 7</a> of
5943+
[[!COOKIES]]), then run the "set-cookie-string" parsing algorithm (see
5944+
<a href=https://httpwg.org/specs/rfc6265.html#set-cookie>section 5.2</a> of [[!COOKIES]]) on the
5945+
<a for=header>value</a> of each <var>header</var> whose <a for=header>name</a> is a
59485946
<a>byte-case-insensitive</a> match for `<code>Set-Cookie</code>` in <var>response</var>'s
59495947
<a for=response>header list</a>, if any, and <var>request</var>'s <a for=request>current URL</a>.
59505948

@@ -7848,7 +7846,7 @@ these steps:
78487846
then <a>throw</a> a {{RangeError}}.
78497847

78507848
<li><p>If <var>init</var>["{{ResponseInit/statusText}}"] does not match the
7851-
<a spec=http>reason-phrase</a> token production, then <a>throw</a> a {{TypeError}}.
7849+
<a spec=http1>reason-phrase</a> token production, then <a>throw</a> a {{TypeError}}.
78527850

78537851
<li><p>Set <var>response</var>'s <a for=Response>response</a>'s <a for=response>status</a> to
78547852
<var>init</var>["{{ResponseInit/status}}"].

0 commit comments

Comments
 (0)