Skip to content

Commit 761c414

Browse files
authored
Editorial: assert that request's origin is not "client"
It's guaranteed that request's origin cannot be "client" after step 10 of the fetch algorithm, but asserting it makes that clearer. Also always link to the definition of "Assert".
1 parent edfa8d1 commit 761c414

File tree

1 file changed

+34
-15
lines changed

1 file changed

+34
-15
lines changed

fetch.bs

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,8 @@ and an optional boolean <var>extract-value</var> (default false):
458458

459459
<li><p>Let <var>value</var> be the empty string.
460460

461-
<li><p>Assert: the <a>code point</a> at <var>position</var> within <var>input</var> is U+0022 (").
461+
<li><p><a for=/>Assert</a>: the <a>code point</a> at <var>position</var> within <var>input</var> is
462+
U+0022 (").
462463

463464
<li><p>Advance <var>position</var> by 1.
464465

@@ -494,7 +495,7 @@ and an optional boolean <var>extract-value</var> (default false):
494495
<p>Otherwise:
495496

496497
<ol>
497-
<li><p>Assert: <var>quoteOrBackslash</var> is U+0022 (").
498+
<li><p><a for=/>Assert</a>: <var>quoteOrBackslash</var> is U+0022 (").
498499

499500
<li><p><a for=iteration>Break</a>.
500501
</ol>
@@ -591,8 +592,8 @@ given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> fr
591592
<a>structured field value</a>.
592593

593594
<ol>
594-
<li><p>Assert: <var>type</var> is one of "<code>dictionary</code>", "<code>list</code>", or
595-
"<code>item</code>".
595+
<li><p><a for=/>Assert</a>: <var>type</var> is one of "<code>dictionary</code>",
596+
"<code>list</code>", or "<code>item</code>".
596597

597598
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var> from
598599
<var>list</var>.
@@ -931,7 +932,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
931932
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var>
932933
from <var>list</var>.
933934

934-
<li><p>Assert: <var>value</var> is non-null.
935+
<li><p><a for=/>Assert</a>: <var>value</var> is non-null.
935936

936937
<li><p><a for=list>Append</a> (<var>name</var>, <var>value</var>) to <var>headers</var>.
937938
</ol>
@@ -2230,6 +2231,9 @@ or "<code>object</code>".
22302231
return true:
22312232

22322233
<ol>
2234+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2235+
"<code>client</code>".
2236+
22332237
<li><p>Let <var>lastURL</var> be null.
22342238

22352239
<li>
@@ -2255,6 +2259,9 @@ return true:
22552259
run these steps:
22562260

22572261
<ol>
2262+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2263+
"<code>client</code>".
2264+
22582265
<li><p>If <var>request</var> has a <a for=request>redirect-tainted origin</a>, then return
22592266
"<code>null</code>".
22602267

@@ -2295,8 +2302,8 @@ is to return the result of <a>serializing a request origin</a> with <var>request
22952302
<var>last</var>, run these steps:
22962303

22972304
<ol>
2298-
<li><p>Assert: <var>last</var> is not given, or <var>first</var> is less than or equal to
2299-
<var>last</var>.
2305+
<li><p><a for=/>Assert</a>: <var>last</var> is not given, or <var>first</var> is less than or equal
2306+
to <var>last</var>.
23002307

23012308
<li><p>Let <var>rangeValue</var> be `<code>bytes=</code>`.
23022309

@@ -2326,7 +2333,8 @@ source of security bugs. Please seek security review for features that deal with
23262333
<var>response</var>, run these steps:
23272334

23282335
<ol>
2329-
<li><p>Assert: <var>response</var>'s <a for=response>URL list</a> <a for=list>is not empty</a>.
2336+
<li><p><a for=/>Assert</a>: <var>response</var>'s <a for=response>URL list</a>
2337+
<a for=list>is not empty</a>.
23302338

23312339
<li>
23322340
<p>Let <var>url</var> be a copy of <var>response</var>'s <a for=response>URL list</a>[0].
@@ -2350,6 +2358,9 @@ source of security bugs. Please seek security review for features that deal with
23502358
<a for=/>request</a> <var>request</var>, run these steps:
23512359

23522360
<ol>
2361+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2362+
"<code>client</code>".
2363+
23532364
<li><p>If <var>request</var>'s <a for=request>mode</a> is not "<code>no-cors</code>", then return
23542365
true.</p>
23552366

@@ -2494,7 +2505,7 @@ this is also tracked internally using the request's <a for=request>timing allow
24942505
<var>fetchParams</var>:
24952506

24962507
<ol>
2497-
<li><p>Assert: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
2508+
<li><p><a for=/>Assert</a>: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
24982509

24992510
<li><p>Return an <a>aborted network error</a> if <var>fetchParams</var> is
25002511
<a for="fetch params">aborted</a>; otherwise return a <a>network error</a>.
@@ -2693,7 +2704,7 @@ manually. [[!HTML]]
26932704
<ol>
26942705
<li><p>If <var>potentialDestination</var> is "<code>fetch</code>", then return the empty string.
26952706

2696-
<li><p>Assert: <var>potentialDestination</var> is a <a for=request>destination</a>.
2707+
<li><p><a for=/>Assert</a>: <var>potentialDestination</var> is a <a for=request>destination</a>.
26972708

26982709
<li><p>Return <var>potentialDestination</var>.
26992710
</ol>
@@ -3089,7 +3100,7 @@ or an <a>implementation-defined</a> value.
30893100
<li><p>If <var>topLevelOrigin</var> is null, then set <var>topLevelOrigin</var> to
30903101
<var>environment</var>'s <a for="environment">top-level creation URL</a>'s <a for=url>origin</a>.
30913102

3092-
<li><p>Assert: <var>topLevelOrigin</var> is an <a for=/>origin</a>.
3103+
<li><p><a for=/>Assert</a>: <var>topLevelOrigin</var> is an <a for=/>origin</a>.
30933104

30943105
<li><p>Let <var>topLevelSite</var> be the result of <a lt="obtain a site">obtaining a site</a>,
30953106
given <var>topLevelOrigin</var>.
@@ -3309,6 +3320,9 @@ request <a for=/>header</a> indicates where a
33093320
given a <a for=/>request</a> <var>request</var>, run these steps:
33103321

33113322
<ol>
3323+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
3324+
"<code>client</code>".
3325+
33123326
<li><p>Let <var>serializedOrigin</var> be the result of <a>byte-serializing a request origin</a>
33133327
with <var>request</var>.
33143328

@@ -5421,7 +5435,8 @@ run these steps:
54215435
<p>If <var>request</var>'s <a for=request>redirect mode</a> is "<code>manual</code>", then:
54225436

54235437
<ol>
5424-
<li><p>Assert: <var>request</var>'s <a for=request>mode</a> is "<code>navigate</code>".
5438+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>mode</a> is
5439+
"<code>navigate</code>".
54255440

54265441
<li><p>Set <var>recursive</var> to false.
54275442
</ol>
@@ -6632,6 +6647,9 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
66326647
<var>response</var>, run these steps:
66336648

66346649
<ol>
6650+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
6651+
"<code>client</code>".
6652+
66356653
<li><p>If <var>request</var>'s <a for=request>timing allow failed flag</a> is set, then return
66366654
failure.
66376655

@@ -7032,7 +7050,7 @@ typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit;</pre>
70327050
<p>If <var>object</var> is a {{ReadableStream}} object, then:
70337051

70347052
<ol>
7035-
<li><p>Assert: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
7053+
<li><p><a for=/>Assert</a>: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
70367054
<a for=ReadableStream>locked</a>.
70377055
</ol>
70387056

@@ -7680,7 +7698,7 @@ constructor steps are:
76807698
<p>Otherwise:
76817699

76827700
<ol>
7683-
<li><p>Assert: <var>input</var> is a {{Request}} object.
7701+
<li><p><a for=/>Assert</a>: <var>input</var> is a {{Request}} object.
76847702

76857703
<li><p>Set <var>request</var> to <var>input</var>'s
76867704
<a for=Request>request</a>.
@@ -8599,7 +8617,7 @@ that RFC's normative processing requirements to be compatible with deployed cont
85998617
<var>dataURL</var> and then runs these steps:
86008618

86018619
<ol>
8602-
<li><p>Assert: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
8620+
<li><p><a for=/>Assert</a>: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
86038621

86048622
<li><p>Let <var>input</var> be the result of running the <a>URL serializer</a> on
86058623
<var>dataURL</var> with <a for="URL serializer"><i>exclude fragment</i></a> set to true.
@@ -9189,6 +9207,7 @@ Shivani Sharma,
91899207
Sigbjørn Finne,
91909208
Simon Pieters,
91919209
Simon Sapin,
9210+
Simon Wülker,
91929211
Srirama Chandra Sekhar Mogali,
91939212
Stephan Paul,
91949213
Steven Salat,

0 commit comments

Comments
 (0)