Skip to content

Commit fea955e

Browse files
Fix more spacing, and make some changes for comments
1 parent fb5a26a commit fea955e

File tree

1 file changed

+60
-53
lines changed

1 file changed

+60
-53
lines changed

fetch.bs

Lines changed: 60 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,9 +2248,9 @@ or "<code>object</code>".
22482248
<hr>
22492249

22502250
<div algorithm>
2251-
<p>A <a for=/>request</a> has a <dfn for=request id=concept-request-redirect-taint>redirect-taint</dfn>,
2252-
which is "<code>same-origin</code>", "<code>same-site</code>", or "<code>cross-site</code>".
2253-
<p>To get <a for=/>request</a> <var>request</var>'s <a>redirect-taint</a>:
2251+
<p>To compute the <dfn for=request id=concept-request-redirect-taint>redirect-taint</dfn> of a
2252+
<a for=/>request</a> <var>request</var>, perform the following steps. They return
2253+
"<code>same-origin</code>", "<code>same-site</code>", or "<code>cross-site</code>".
22542254

22552255
<ol>
22562256
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
@@ -2517,7 +2517,7 @@ this is also tracked internally using the request's <a for=request>timing allow
25172517
<a for=/>service worker timing info</a>), which is initially null.
25182518

25192519
<p>A <a for=/>response</a> has an associated <dfn for=response>redirect taint</dfn>
2520-
("<code>same-origin</code>", "<code>same-site</code>", or "<code>cross-site</code>", which is
2520+
("<code>same-origin</code>", "<code>same-site</code>", or "<code>cross-site</code>"), which is
25212521
initially "<code>same-origin</code>".
25222522

25232523
<hr>
@@ -4268,70 +4268,77 @@ We define infrastructure to be able to use them conveniently here.
42684268
given a <a for=/>request</a> <var>request</var>, run these steps:
42694269

42704270
<ol>
4271-
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should
4272-
return.
4271+
<li><p>If the user agent is configured to disable cookies for <var>request</var>, it should
4272+
return.
42734273

4274-
<li><p>Let |sameSite| be the result of [=determining the same-site mode=] for <var>request</var>.
4274+
<li><p>Let |sameSite| be the result of [=determining the same-site mode=] for <var>request</var>.
42754275

4276-
<li><p>Let |isSecure| be false.
4276+
<li><p>Let |isSecure| be false.
42774277

4278-
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, then set
4279-
|isSecure| to true.
4278+
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, then set
4279+
|isSecure| to true.
42804280

4281-
<li><p>Let |httpOnlyAllowed| be true.
4281+
<li>
4282+
<p>Let |httpOnlyAllowed| be true.
42824283

4283-
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4284+
<p class=note>Since this algorithm is performed on a <a for=/>request</a>, we know that the
4285+
cookies were comsumed by HTTP, rather than script mechanisms such as
4286+
<code>document.cookie</code>.
42844287

4285-
<li><p>Let |cookies| be the result of running <a>retrieve cookies</a> given |isSecure|,
4288+
<li>
4289+
<p>Let |cookies| be the result of running <a>retrieve cookies</a> given |isSecure|,
42864290
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a>, <var>request</var>'s
4287-
<a for=request>current URL</a>'s <a for=url>path</a>, |httpOnlyAllowed|, and |sameSite|
4291+
<a for=request>current URL</a>'s <a for=url>path</a>, |httpOnlyAllowed|, and |sameSite|.
42884292

42894293
<p class=note>It is expected that the cookie store returns an ordered list of cookies
42904294

4291-
<li>If |cookies| <a for="list">is empty</a>, then return.
4295+
<li>If |cookies| <a for="list">is empty</a>, then return.
42924296

4293-
<li>Let |value| be the result of running <a>serialize cookies</a> given |cookies|.
4297+
<li>Let |value| be the result of running <a>serialize cookies</a> given |cookies|.
42944298

4295-
<li><a for="header list">Append</a> (`<code>Cookie</code>`, <var>value</var>) to
4296-
<var>request</var>'s <a for=request>header list</a>.
4299+
<li><a for="header list">Append</a> (`<code>Cookie</code>`, <var>value</var>) to
4300+
<var>request</var>'s <a for=request>header list</a>.
42974301
</ol>
42984302
</div>
42994303

43004304
<div algorithm>
43014305
<p>To <dfn id=parse-and-store-response-cookie-headers>parse and store response
4302-
`<code>Set-Cookie</code>` headers</dfn>, given a <a for=/>request</a> <var>request</var> and a <a
4303-
for=/>response</a> <var>response</var>, run these steps:
4306+
`<code>Set-Cookie</code>` headers</dfn>, given a <a for=/>request</a> <var>request</var> and a
4307+
<a for=/>response</a> <var>response</var>, run these steps:
43044308

43054309
<ol>
4306-
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should
4307-
return.
4310+
<li><p>If the user agent is configured to disable cookies for <var>request</var>,
4311+
then it should return.
43084312

4309-
<li><p>Let |allowNonHostOnlyCookieForPublicSuffix| be false.
4313+
<li><p>Let |allowNonHostOnlyCookieForPublicSuffix| be false.
43104314

4311-
<li><p>Let |isSecure| be false.
4315+
<li><p>Let |isSecure| be false.
43124316

4313-
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, set
4314-
|isSecure| to true.
4317+
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, set
4318+
|isSecure| to true.
43154319

4316-
<li><p>Let |httpOnlyAllowed| be true.
4320+
<li>
4321+
<p>Let |httpOnlyAllowed| be true.
43174322

4318-
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4323+
<p class=note>Since this algorithm is performed on a <a for=/>request</a>, we know that the
4324+
cookies were produced from HTTP, rather than script mechanisms such as
4325+
<code>document.cookie</code>.
43194326

4320-
<li><p>Let |sameSiteStrictOrLaxAllowed| be true if the result of [=determine the same-site mode=]
4321-
for |request| is "<code>StrictOrLess</code>", and false otherwise.
4327+
<li><p>Let |sameSiteStrictOrLaxAllowed| be true if the result of [=determine the same-site mode=]
4328+
for |request| is "<code>StrictOrLess</code>", and false otherwise.
43224329

4323-
<li><p><a for=list>For each</a> <var>header</var> of <var>response</var>'s <a for=response>header
4324-
list</a>:
4330+
<li><p><a for=list>For each</a> <var>header</var> of <var>response</var>'s
4331+
<a for=response>header list</a>:
43254332

4326-
<ol>
4327-
<li><p>If <var>header</var>'s <a for=header>name</a> is not a <a>byte-case-insensitive</a> match
4328-
for `<code>Set-Cookie</code>`, <a for=iteration>continue</a>.
4333+
<ol>
4334+
<li><p>If <var>header</var>'s <a for=header>name</a> is not a <a>byte-case-insensitive</a> match
4335+
for `<code>Set-Cookie</code>`, <a for=iteration>continue</a>.
43294336

4330-
<li><p><a>Parse and store a cookie</a> given <var>header</var>'s <a for=header>value</a>,
4331-
|isSecure|, <var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a>,
4332-
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>path</a>, |httpOnlyAllowed|,
4333-
|allowNonHostOnlyCookieForPublicSuffix|, and |sameSiteStrictOrLaxAllowed|
4334-
</ol>
4337+
<li><p><a>Parse and store a cookie</a> given <var>header</var>'s <a for=header>value</a>,
4338+
|isSecure|, <var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a>,
4339+
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>path</a>, |httpOnlyAllowed|,
4340+
|allowNonHostOnlyCookieForPublicSuffix|, and |sameSiteStrictOrLaxAllowed|.
4341+
</ol>
43354342
</ol>
43364343
</div>
43374344

@@ -4340,22 +4347,22 @@ for=/>response</a> <var>response</var>, run these steps:
43404347
run these steps:
43414348

43424349
<ol>
4343-
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>method</a> is "GET" or "POST".
4350+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>method</a> is "GET" or "POST".
43444351

4345-
<li><p>If <var>request</var>'s <a for=request>top-level navigation initiator origin</a> is not
4346-
null and is not <a for=/>same site</a> to <var>request</var>'s <a for=request>URL</a>'s
4347-
<a for=url>origin</a>, return "<code>UnsetOrLess</code>".
4352+
<li><p>If <var>request</var>'s <a for=request>top-level navigation initiator origin</a> is not
4353+
null and is not <a for=/>same site</a> to <var>request</var>'s <a for=request>URL</a>'s
4354+
<a for=url>origin</a>, return "<code>UnsetOrLess</code>".
43484355

4349-
<li><p>If <var>request</var>'s <a for=request>method</a> is "GET" and <var>request</var>'s <a
4350-
for=request>destination</a> is "document", return "<code>LaxOrLess</code>".
4356+
<li><p>If <var>request</var>'s <a for=request>method</a> is "GET" and <var>request</var>'s
4357+
<a for=request>destination</a> is "document", return "<code>LaxOrLess</code>".
43514358

4352-
<li><p>If <var>request</var>'s <a for=request>client</a>'s <a for=environment>ancestry</a> is
4353-
"<code>cross-site</code>", return "<code>UnsetOrLess</code>".
4359+
<li><p>If <var>request</var>'s <a for=request>client</a>'s <a for=environment>ancestry</a> is
4360+
"<code>cross-site</code>", return "<code>UnsetOrLess</code>".
43544361

4355-
<li><p>If <var>request</var>'s <a for=request>redirect-taint</a> is "<code>cross-site</code>",
4356-
return "<code>UnsetOrLess</code>".
4362+
<li><p>If <var>request</var>'s <a for=request>redirect-taint</a> is "<code>cross-site</code>",
4363+
return "<code>UnsetOrLess</code>".
43574364

4358-
<li><p>Return "StrictOrLess".
4365+
<li><p>Return "StrictOrLess".
43594366
</ol>
43604367
</div>
43614368

@@ -6406,8 +6413,8 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
64066413
<li><p>Set <var>response</var>'s <a for=response>body</a> to a new <a for=/>body</a> whose
64076414
<a for=body>stream</a> is <var>stream</var>.
64086415

6409-
<li><p tracking-vector>If <var>includeCredentials</var> is true, the user agent should <a>parse and
6410-
store response `<code>Set-Cookie</code>` headers</a> given <var>request</var> and
6416+
<li><p tracking-vector>If <var>includeCredentials</var> is true, the user agent should
6417+
<a>parse and store response `<code>Set-Cookie</code>` headers</a> given <var>request</var> and
64116418
<var>response</var>.
64126419

64136420
<li>

0 commit comments

Comments
 (0)