Skip to content

Commit fb5a26a

Browse files
Fix spacing
1 parent 853595b commit fb5a26a

File tree

1 file changed

+96
-59
lines changed

1 file changed

+96
-59
lines changed

fetch.bs

Lines changed: 96 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1957,8 +1957,8 @@ not always relevant and might require different behavior.
19571957
"<code>client</code>".
19581958

19591959
<p>A <a for=/>request</a> has an associated
1960-
<dfn export for=request id=concept-request-navigation-initiator-origin>top-level navigation initiator origin</dfn>, which is
1961-
an <a for=/>origin</a> or null. Unless stated otherwise it is null.
1960+
<dfn export for=request id=concept-request-navigation-initiator-origin>top-level navigation
1961+
initiator origin</dfn>, which is an <a for=/>origin</a> or null. Unless stated otherwise it is null.
19621962

19631963
<p class=note>"<code>client</code>" is changed to an <a for=/>origin</a> during
19641964
<a lt=fetch for=/>fetching</a>. It provides a convenient way for standards to not have to set
@@ -2269,12 +2269,13 @@ which is "<code>same-origin</code>", "<code>same-site</code>", or "<code>cross-s
22692269

22702270
<li><p>If <var>url</var>'s <a for=url>origin</a> is not <a for=/>same site</a> with
22712271
<var>lastURL</var>'s <a for=url>origin</a> and <var>request</var>'s <a for=request>origin</a> is
2272-
not <a for=/>same site</a> with <var>lastURL</var>'s <a for=url>origin</a>, then return "<code>cross-site</code>".
2272+
not <a for=/>same site</a> with <var>lastURL</var>'s <a for=url>origin</a>, then return
2273+
"<code>cross-site</code>".
22732274

22742275
<li><p>If <var>url</var>'s <a for=url>origin</a> is not <a>same origin</a> with
22752276
<var>lastURL</var>'s <a for=url>origin</a> and <var>request</var>'s <a for=request>origin</a> is
2276-
not <a>same origin</a> with <var>lastURL</var>'s <a for=url>origin</a>,
2277-
then set <var>computedTaint</var> to "<code>same-site</code>".
2277+
not <a>same origin</a> with <var>lastURL</var>'s <a for=url>origin</a>, then set
2278+
<var>computedTaint</var> to "<code>same-site</code>".
22782279

22792280
<li>Set <var>lastURL</var> to <var>url</var>.
22802281
</ol>
@@ -2515,8 +2516,9 @@ this is also tracked internally using the request's <a for=request>timing allow
25152516
<dfn export for=response>service worker timing info</dfn> (null or a
25162517
<a for=/>service worker timing info</a>), which is initially null.
25172518

2518-
<p>A <a for=/>response</a> has an associated <dfn for=response>redirect taint</dfn> ("<code>same-origin</code>",
2519-
"<code>same-site</code>", or "<code>cross-site</code>", which is initially "<code>same-origin</code>".
2519+
<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
2521+
initially "<code>same-origin</code>".
25202522

25212523
<hr>
25222524

@@ -4259,69 +4261,102 @@ prefetch, or to treat it differently when counting page visits.
42594261
<h3 id=cookie-header>`<code>Cookie</code>` header</h3>
42604262

42614263
<p>The `<code>Cookie</code>` header is largely defined in its own specification. [[COOKIES]].
4262-
We define infrastructure to be able to use conveniently here.
4264+
We define infrastructure to be able to use them conveniently here.
42634265

42644266
<div algorithm>
42654267
<p>To <dfn id=append-a-request-cookie-header>append a request `<code>Cookie</code>` header</dfn>,
42664268
given a <a for=/>request</a> <var>request</var>, run these steps:
4267-
<ol>
4268-
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should return.
4269-
<li><p>Let |sameSite| be the result of [=determining the same-site mode=] for <var>request</var>.
4270-
<li><p>Let |isSecure| be false.
4271-
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, then set |isSecure| to true.
4272-
<li><p>Let |httpOnlyAllowed| be true.
4273-
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4274-
<li><p>Let |cookies| be the result of running <a>retrieve cookies</a> given
4275-
|isSecure|,
4276-
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a>,
4277-
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>path</a>,
4278-
|httpOnlyAllowed|, and
4279-
|sameSite|
4280-
4281-
<p class=note>It is expected that the cookie store returns an ordered list of cookies
4282-
<li>If |cookies| <a for="list">is empty</a>, then return.
4283-
<li>Let |value| be the result of running <a>serialize cookies</a> given |cookies|.
4284-
<li><a for="header list">Append</a> (`<code>Cookie</code>`, <var>value</var>) to <var>request</var>'s <a for=request>header list</a>.
4285-
</ol>
4269+
4270+
<ol>
4271+
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should
4272+
return.
4273+
4274+
<li><p>Let |sameSite| be the result of [=determining the same-site mode=] for <var>request</var>.
4275+
4276+
<li><p>Let |isSecure| be false.
4277+
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.
4280+
4281+
<li><p>Let |httpOnlyAllowed| be true.
4282+
4283+
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4284+
4285+
<li><p>Let |cookies| be the result of running <a>retrieve cookies</a> given |isSecure|,
4286+
<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|
4288+
4289+
<p class=note>It is expected that the cookie store returns an ordered list of cookies
4290+
4291+
<li>If |cookies| <a for="list">is empty</a>, then return.
4292+
4293+
<li>Let |value| be the result of running <a>serialize cookies</a> given |cookies|.
4294+
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>.
4297+
</ol>
42864298
</div>
42874299

42884300
<div algorithm>
4289-
<p>To <dfn id=parse-and-store-response-cookie-headers>parse and store response `<code>Set-Cookie</code>` headers</dfn>,
4290-
given a <a for=/>request</a> <var>request</var> and a <a for=/>response</a> <var>response</var>, run these steps:
4301+
<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:
4304+
4305+
<ol>
4306+
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should
4307+
return.
4308+
4309+
<li><p>Let |allowNonHostOnlyCookieForPublicSuffix| be false.
4310+
4311+
<li><p>Let |isSecure| be false.
4312+
4313+
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, set
4314+
|isSecure| to true.
4315+
4316+
<li><p>Let |httpOnlyAllowed| be true.
4317+
4318+
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4319+
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.
4322+
4323+
<li><p><a for=list>For each</a> <var>header</var> of <var>response</var>'s <a for=response>header
4324+
list</a>:
4325+
42914326
<ol>
4292-
<li><p>If the user-agent is configured to disable cookies for <var>request</var>, it should return.
4293-
<li><p>Let |allowNonHostOnlyCookieForPublicSuffix| be false.
4294-
<li><p>Let |isSecure| be false.
4295-
<li><p>If <var>request</var>'s <a for=request>client</a> is a <a>secure context</a>, then set |isSecure| to true.
4296-
<li><p>Let |httpOnlyAllowed| be true.
4297-
<p class=note>Fetch implies that the request is http-only, as opposed to document.cookie
4298-
<li><p>Let |sameSiteStrictOrLaxAllowed| be true if the result of [=determine the same-site mode=] for |request| is "<code>StrictOrLess</code>", and false otherwise.
4299-
<li><p><a for=list>For each</a> <var>header</var> of <var>response</var>'s <a for=response>header list</a>:
4300-
<ol>
4301-
<li><p>If <var>header</var>'s <a for=header>name</a> is not a <a>byte-case-insensitive</a> match for `<code>Set-Cookie</code>`, then <a for=iteration>continue</a>.
4302-
<li><p><a>Parse and store a cookie</a> given
4303-
<var>header</var>'s <a for=header>value</a>,
4304-
|isSecure|,
4305-
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>host</a>,
4306-
<var>request</var>'s <a for=request>current URL</a>'s <a for=url>path</a>,
4307-
|httpOnlyAllowed|,
4308-
|allowNonHostOnlyCookieForPublicSuffix|, and
4309-
|sameSiteStrictOrLaxAllowed|
4310-
</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>.
4329+
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|
43114334
</ol>
4335+
</ol>
43124336
</div>
43134337

43144338
<div algorithm>
4315-
<p>To <dfn>determine the same-site mode</dfn> for a given <a for=/>request</a> <var>request</var>, run these steps:
4316-
<ol>
4317-
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>method</a> is "GET" or "POST".
4318-
<li><p>If <var>request</var>'s <a for=request>top-level navigation initiator origin</a> is not null and is not <a for=/>same site</a> to <var>request</var>'s <a for=request>URL</a>'s <a for=url>origin</a>, return "<code>UnsetOrLess</code>".
4319-
<li><p>If <var>request</var>'s <a for=request>method</a> is "GET" and
4320-
<var>request</var>'s <a for=request>destination</a> is "document", return "<code>LaxOrLess</code>".
4321-
<li><p>If <var>request</var>'s <a for=request>client</a>'s <a for=environment>ancestry</a> is "<code>cross-site</code>", return "<code>UnsetOrLess</code>".
4322-
<li><p>If <var>request</var>'s <a for=request>redirect-taint</a> is "<code>cross-site</code>", return "<code>UnsetOrLess</code>".
4323-
<li><p>Return "StrictOrLess".
4324-
</ol>
4339+
<p>To <dfn>determine the same-site mode</dfn> for a given <a for=/>request</a> <var>request</var>,
4340+
run these steps:
4341+
4342+
<ol>
4343+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>method</a> is "GET" or "POST".
4344+
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>".
4348+
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>".
4351+
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>".
4354+
4355+
<li><p>If <var>request</var>'s <a for=request>redirect-taint</a> is "<code>cross-site</code>",
4356+
return "<code>UnsetOrLess</code>".
4357+
4358+
<li><p>Return "StrictOrLess".
4359+
</ol>
43254360
</div>
43264361

43274362
<h2 id=fetching>Fetching</h2>
@@ -6371,7 +6406,9 @@ optional boolean <var>forceNewConnection</var> (default false), run these steps:
63716406
<li><p>Set <var>response</var>'s <a for=response>body</a> to a new <a for=/>body</a> whose
63726407
<a for=body>stream</a> is <var>stream</var>.
63736408

6374-
<li><p tracking-vector>If <var>includeCredentials</var> is true, the user agent should <a>parse and store response `<code>Set-Cookie</code>` headers</a> given <var>request</var> and <var>response</var>.
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
6411+
<var>response</var>.
63756412

63766413
<li>
63776414
<p>Run these steps <a>in parallel</a>:

0 commit comments

Comments
 (0)