Skip to content

Commit dd60299

Browse files
simonwuelkermeacer
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 5affdfe commit dd60299

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>
@@ -2241,6 +2242,9 @@ or "<code>object</code>".
22412242
return true:
22422243

22432244
<ol>
2245+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2246+
"<code>client</code>".
2247+
22442248
<li><p>Let <var>lastURL</var> be null.
22452249

22462250
<li>
@@ -2266,6 +2270,9 @@ return true:
22662270
run these steps:
22672271

22682272
<ol>
2273+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2274+
"<code>client</code>".
2275+
22692276
<li><p>If <var>request</var> has a <a for=request>redirect-tainted origin</a>, then return
22702277
"<code>null</code>".
22712278

@@ -2306,8 +2313,8 @@ is to return the result of <a>serializing a request origin</a> with <var>request
23062313
<var>last</var>, run these steps:
23072314

23082315
<ol>
2309-
<li><p>Assert: <var>last</var> is not given, or <var>first</var> is less than or equal to
2310-
<var>last</var>.
2316+
<li><p><a for=/>Assert</a>: <var>last</var> is not given, or <var>first</var> is less than or equal
2317+
to <var>last</var>.
23112318

23122319
<li><p>Let <var>rangeValue</var> be `<code>bytes=</code>`.
23132320

@@ -2337,7 +2344,8 @@ source of security bugs. Please seek security review for features that deal with
23372344
<var>response</var>, run these steps:
23382345

23392346
<ol>
2340-
<li><p>Assert: <var>response</var>'s <a for=response>URL list</a> <a for=list>is not empty</a>.
2347+
<li><p><a for=/>Assert</a>: <var>response</var>'s <a for=response>URL list</a>
2348+
<a for=list>is not empty</a>.
23412349

23422350
<li>
23432351
<p>Let <var>url</var> be a copy of <var>response</var>'s <a for=response>URL list</a>[0].
@@ -2361,6 +2369,9 @@ source of security bugs. Please seek security review for features that deal with
23612369
<a for=/>request</a> <var>request</var>, run these steps:
23622370

23632371
<ol>
2372+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
2373+
"<code>client</code>".
2374+
23642375
<li><p>If <var>request</var>'s <a for=request>mode</a> is not "<code>no-cors</code>", then return
23652376
true.</p>
23662377

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

25072518
<ol>
2508-
<li><p>Assert: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
2519+
<li><p><a for=/>Assert</a>: <var>fetchParams</var> is <a for="fetch params">canceled</a>.
25092520

25102521
<li><p>Return an <a>aborted network error</a> if <var>fetchParams</var> is
25112522
<a for="fetch params">aborted</a>; otherwise return a <a>network error</a>.
@@ -2704,7 +2715,7 @@ manually. [[!HTML]]
27042715
<ol>
27052716
<li><p>If <var>potentialDestination</var> is "<code>fetch</code>", then return the empty string.
27062717

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

27092720
<li><p>Return <var>potentialDestination</var>.
27102721
</ol>
@@ -3100,7 +3111,7 @@ or an <a>implementation-defined</a> value.
31003111
<li><p>If <var>topLevelOrigin</var> is null, then set <var>topLevelOrigin</var> to
31013112
<var>environment</var>'s <a for="environment">top-level creation URL</a>'s <a for=url>origin</a>.
31023113

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

31053116
<li><p>Let <var>topLevelSite</var> be the result of <a lt="obtain a site">obtaining a site</a>,
31063117
given <var>topLevelOrigin</var>.
@@ -3438,6 +3449,9 @@ request <a for=/>header</a> indicates where a
34383449
given a <a for=/>request</a> <var>request</var>, run these steps:
34393450

34403451
<ol>
3452+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
3453+
"<code>client</code>".
3454+
34413455
<li><p>Let <var>serializedOrigin</var> be the result of <a>byte-serializing a request origin</a>
34423456
with <var>request</var>.
34433457

@@ -5552,7 +5566,8 @@ run these steps:
55525566
<p>If <var>request</var>'s <a for=request>redirect mode</a> is "<code>manual</code>", then:
55535567

55545568
<ol>
5555-
<li><p>Assert: <var>request</var>'s <a for=request>mode</a> is "<code>navigate</code>".
5569+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>mode</a> is
5570+
"<code>navigate</code>".
55565571

55575572
<li><p>Set <var>recursive</var> to false.
55585573
</ol>
@@ -6764,6 +6779,9 @@ agent's <a>CORS-preflight cache</a> for which there is a <a>cache entry match</a
67646779
<var>response</var>, run these steps:
67656780

67666781
<ol>
6782+
<li><p><a for=/>Assert</a>: <var>request</var>'s <a for=request>origin</a> is not
6783+
"<code>client</code>".
6784+
67676785
<li><p>If <var>request</var>'s <a for=request>timing allow failed flag</a> is set, then return
67686786
failure.
67696787

@@ -7164,7 +7182,7 @@ typedef (ReadableStream or XMLHttpRequestBodyInit) BodyInit;</pre>
71647182
<p>If <var>object</var> is a {{ReadableStream}} object, then:
71657183

71667184
<ol>
7167-
<li><p>Assert: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
7185+
<li><p><a for=/>Assert</a>: <var>object</var> is neither <a for=ReadableStream>disturbed</a> nor
71687186
<a for=ReadableStream>locked</a>.
71697187
</ol>
71707188

@@ -7812,7 +7830,7 @@ constructor steps are:
78127830
<p>Otherwise:
78137831

78147832
<ol>
7815-
<li><p>Assert: <var>input</var> is a {{Request}} object.
7833+
<li><p><a for=/>Assert</a>: <var>input</var> is a {{Request}} object.
78167834

78177835
<li><p>Set <var>request</var> to <var>input</var>'s
78187836
<a for=Request>request</a>.
@@ -8731,7 +8749,7 @@ that RFC's normative processing requirements to be compatible with deployed cont
87318749
<var>dataURL</var> and then runs these steps:
87328750

87338751
<ol>
8734-
<li><p>Assert: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
8752+
<li><p><a for=/>Assert</a>: <var>dataURL</var>'s <a for=url>scheme</a> is "<code>data</code>".
87358753

87368754
<li><p>Let <var>input</var> be the result of running the <a>URL serializer</a> on
87378755
<var>dataURL</var> with <a for="URL serializer"><i>exclude fragment</i></a> set to true.
@@ -9322,6 +9340,7 @@ Shivani Sharma,
93229340
Sigbjørn Finne,
93239341
Simon Pieters,
93249342
Simon Sapin,
9343+
Simon Wülker,
93259344
Srirama Chandra Sekhar Mogali,
93269345
Stephan Paul,
93279346
Steven Salat,

0 commit comments

Comments
 (0)