Skip to content

Commit 805b769

Browse files
simonwuelkerpmeenan
authored andcommitted
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 d0fa420 commit 805b769

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
@@ -465,7 +465,8 @@ and an optional boolean <var>extract-value</var> (default false):
465465

466466
<li><p>Let <var>value</var> be the empty string.
467467

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

470471
<li><p>Advance <var>position</var> by 1.
471472

@@ -501,7 +502,7 @@ and an optional boolean <var>extract-value</var> (default false):
501502
<p>Otherwise:
502503

503504
<ol>
504-
<li><p>Assert: <var>quoteOrBackslash</var> is U+0022 (").
505+
<li><p><a for=/>Assert</a>: <var>quoteOrBackslash</var> is U+0022 (").
505506

506507
<li><p><a for=iteration>Break</a>.
507508
</ol>
@@ -598,8 +599,8 @@ given a <a for=/>header name</a> <var>name</var> and a string <var>type</var> fr
598599
<a>structured field value</a>.
599600

600601
<ol>
601-
<li><p>Assert: <var>type</var> is one of "<code>dictionary</code>", "<code>list</code>", or
602-
"<code>item</code>".
602+
<li><p><a for=/>Assert</a>: <var>type</var> is one of "<code>dictionary</code>",
603+
"<code>list</code>", or "<code>item</code>".
603604

604605
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var> from
605606
<var>list</var>.
@@ -938,7 +939,7 @@ directly. Use <a for="header list">get, decode, and split</a> instead.
938939
<li><p>Let <var>value</var> be the result of <a for="header list">getting</a> <var>name</var>
939940
from <var>list</var>.
940941

941-
<li><p>Assert: <var>value</var> is non-null.
942+
<li><p><a for=/>Assert</a>: <var>value</var> is non-null.
942943

943944
<li><p><a for=list>Append</a> (<var>name</var>, <var>value</var>) to <var>headers</var>.
944945
</ol>
@@ -2238,6 +2239,9 @@ or "<code>object</code>".
22382239
return true:
22392240

22402241
<ol>
2242+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2243+
"<code>client</code>".
2244+
22412245
<li><p>Let <var>lastURL</var> be null.
22422246

22432247
<li>
@@ -2263,6 +2267,9 @@ return true:
22632267
run these steps:
22642268

22652269
<ol>
2270+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2271+
"<code>client</code>".
2272+
22662273
<li><p>If <var>request</var> has a <a for=request>redirect-tainted origin</a>, then return
22672274
"<code>null</code>".
22682275

@@ -2303,8 +2310,8 @@ is to return the result of <a>serializing a request origin</a> with <var>request
23032310
<var>last</var>, run these steps:
23042311

23052312
<ol>
2306-
<li><p>Assert: <var>last</var> is not given, or <var>first</var> is less than or equal to
2307-
<var>last</var>.
2313+
<li><p><a for=/>Assert</a>: <var>last</var> is not given, or <var>first</var> is less than or equal
2314+
to <var>last</var>.
23082315

23092316
<li><p>Let <var>rangeValue</var> be `<code>bytes=</code>`.
23102317

@@ -2334,7 +2341,8 @@ source of security bugs. Please seek security review for features that deal with
23342341
<var>response</var>, run these steps:
23352342

23362343
<ol>
2337-
<li><p>Assert: <var>response</var>'s <a for=response>URL list</a> <a for=list>is not empty</a>.
2344+
<li><p><a for=/>Assert</a>: <var>response</var>'s <a for=response>URL list</a>
2345+
<a for=list>is not empty</a>.
23382346

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

23602368
<ol>
2369+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2370+
"<code>client</code>".
2371+
23612372
<li><p>If <var>request</var>'s <a for=request>mode</a> is not "<code>no-cors</code>", then return
23622373
true.</p>
23632374

@@ -2502,7 +2513,7 @@ this is also tracked internally using the request's <a for=request>timing allow
25022513
<var>fetchParams</var>:
25032514

25042515
<ol>
2505-
<li><p>Assert: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
2516+
<li><p><a for=/>Assert</a>: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
25062517

25072518
<li><p>Return an <a>aborted network error</a> if <var>fetchParams</var> is
25082519
<a for="fetch params">aborted</a>; otherwise return a <a>network error</a>.
@@ -2701,7 +2712,7 @@ manually. [[!HTML]]
27012712
<ol>
27022713
<li><p>If <var>potentialDestination</var> is "<code>fetch</code>", then return the empty string.
27032714

2704-
<li><p>Assert: <var>potentialDestination</var> is a <a for=request>destination</a>.
2715+
<li><p><a for=/>Assert</a>: <var>potentialDestination</var> is a <a for=request>destination</a>.
27052716

27062717
<li><p>Return <var>potentialDestination</var>.
27072718
</ol>
@@ -3097,7 +3108,7 @@ or an <a>implementation-defined</a> value.
30973108
<li><p>If <var>topLevelOrigin</var> is null, then set <var>topLevelOrigin</var> to
30983109
<var>environment</var>'s <a for="environment">top-level creation URL</a>'s <a for=url>origin</a>.
30993110

3100-
<li><p>Assert: <var>topLevelOrigin</var> is an <a for=/>origin</a>.
3111+
<li><p><a for=/>Assert</a>: <var>topLevelOrigin</var> is an <a for=/>origin</a>.
31013112

31023113
<li><p>Let <var>topLevelSite</var> be the result of <a lt="obtain a site">obtaining a site</a>,
31033114
given <var>topLevelOrigin</var>.
@@ -3317,6 +3328,9 @@ request <a for=/>header</a> indicates where a
33173328
given a <a for=/>request</a> <var>request</var>, run these steps:
33183329

33193330
<ol>
3331+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
3332+
"<code>client</code>".
3333+
33203334
<li><p>Let <var>serializedOrigin</var> be the result of <a>byte-serializing a request origin</a>
33213335
with <var>request</var>.
33223336

@@ -5429,7 +5443,8 @@ run these steps:
54295443
<p>If <var>request</var>'s <a for=request>redirect mode</a> is "<code>manual</code>", then:
54305444

54315445
<ol>
5432-
<li><p>Assert: <var>request</var>'s <a for=request>mode</a> is "<code>navigate</code>".
5446+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>mode</a> is
5447+
"<code>navigate</code>".
54335448

54345449
<li><p>Set <var>recursive</var> to false.
54355450
</ol>
@@ -6693,6 +6708,9 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
66936708
<var>response</var>, run these steps:
66946709

66956710
<ol>
6711+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
6712+
"<code>client</code>".
6713+
66966714
<li><p>If <var>request</var>'s <a for=request>timing allow failed flag</a> is set, then return
66976715
failure.
66986716

@@ -7093,7 +7111,7 @@ typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit;</pre>
70937111
<p>If <var>object</var> is a {{ReadableStream}} object, then:
70947112

70957113
<ol>
7096-
<li><p>Assert: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
7114+
<li><p><a for=/>Assert</a>: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
70977115
<a for=ReadableStream>locked</a>.
70987116
</ol>
70997117

@@ -7741,7 +7759,7 @@ constructor steps are:
77417759
<p>Otherwise:
77427760

77437761
<ol>
7744-
<li><p>Assert: <var>input</var> is a {{Request}} object.
7762+
<li><p><a for=/>Assert</a>: <var>input</var> is a {{Request}} object.
77457763

77467764
<li><p>Set <var>request</var> to <var>input</var>'s
77477765
<a for=Request>request</a>.
@@ -8660,7 +8678,7 @@ that RFC's normative processing requirements to be compatible with deployed cont
86608678
<var>dataURL</var> and then runs these steps:
86618679

86628680
<ol>
8663-
<li><p>Assert: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
8681+
<li><p><a for=/>Assert</a>: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
86648682

86658683
<li><p>Let <var>input</var> be the result of running the <a>URL serializer</a> on
86668684
<var>dataURL</var> with <a for="URL serializer"><i>exclude fragment</i></a> set to true.
@@ -9250,6 +9268,7 @@ Shivani Sharma,
92509268
Sigbjørn Finne,
92519269
Simon Pieters,
92529270
Simon Sapin,
9271+
Simon Wülker,
92539272
Srirama Chandra Sekhar Mogali,
92549273
Stephan Paul,
92559274
Steven Salat,

0 commit comments

Comments
 (0)