Skip to content

Commit b4a50f9

Browse files
committed
Address Yoav's comments
1 parent e2eaac4 commit b4a50f9

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

fetch.bs

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3270,7 +3270,7 @@ steps:
32703270
<li>
32713271
<p>If one or more of the following conditions are met, return without modifying request:
32723272
<ul>
3273-
<li><p><var>request</var>'s <a for="request">destination</a> is "<code>document</code>"
3273+
<li><p><var>request</var>'s <a for="request">destination</a> is not "<code>document</code>"
32743274

32753275
<li><p><var>request</var>'s <a for="request">method</a> is not "<code>GET</code>"
32763276

@@ -3285,9 +3285,10 @@ steps:
32853285
</ul>
32863286
</li>
32873287

3288-
<li><p>If <var>request</var>'s <code>https-upgrade-fallback-url</code> is non-null, this is a
3289-
fallback request that shouldn't be upgraded again. Clear the <code>https-upgrade</code> and
3290-
<code>https-upgrade-fallback-url</code> flags and return.
3288+
<li><p>If <var>request</var>'s <code>https-upgrade-fallback-url</code> is non-null, clear the
3289+
<code>https-upgrade</code> and <code>https-upgrade-fallback-url</code> flags and return.
3290+
3291+
<p class="note">This is a fallback request that shouldn't be upgraded again.
32913292

32923293
<li><p>Otherwise, upgrade the request by setting the following fields:
32933294
<ul>
@@ -3300,20 +3301,26 @@ steps:
33003301

33013302
<h4 id=https-upgrades-fallback>Fallback algorithm</h4>
33023303

3303-
To <dfn>HTTPS upgrade fallback</dfn> given a <a for=/>request</a>
3304+
To run <dfn>HTTPS upgrade fallback</dfn> given a <a for=/>request</a>
33043305
<var>request</var> and <a for=/>response</a> <var>response</var>, run these steps:
33053306

33063307
<ol>
3307-
<li><p>If <var>request</var>'s <code>https-upgrade</code> flag is not set, the <var>request</var>
3308-
was not upgraded. Return <var>response</var>.
3308+
<li><p>If <var>request</var>'s <code>https-upgrade</code> flag is not set, return
3309+
<var>response</var>.
3310+
3311+
<p class="note">This means <var>request</var> was not upgraded.
33093312

33103313
<li>
33113314
<p>Otherwise, the request was upgraded.
33123315

33133316
<p>If <var>response</var> is a network error, the upgrade failed. Initiate a fallback
3314-
load by creating a synthetic redirect response <var>fallbackResponse</var> that redirects to
3315-
<var>request</var>'s <code>https-upgrade-fallback-url</code> flag with status 307.
3316-
Return <var>fallbackResponse</var>.
3317+
load by running the following steps:
3318+
3319+
<ol>
3320+
<li><p>Create a synthetic redirect response <var>fallbackResponse</var> that redirects to
3321+
<var>request</var>'s <code>https-upgrade-fallback-url</code> flag with status 307.
3322+
<li>Return <var>fallbackResponse</var>.
3323+
</ol>
33173324

33183325
<li><p>Otherwise, the upgrade was successful. Return <var>response</var>.
33193326
</ol>
@@ -5243,12 +5250,14 @@ these steps:
52435250
<a>filtered response</a>; otherwise to <var>response</var>'s
52445251
<a for="filtered response">internal response</a>.
52455252

5253+
<li><p>If <var>response</var>'s <a for=response>type</a> is "<code>error</code>" then
5254+
return the result of running <a>HTTPS upgrade fallback</a> given <var>request</var>
5255+
and a <a>network error</a>.
5256+
52465257
<li>
52475258
<p>If one of the following is true
52485259

52495260
<ul class=brief>
5250-
<li><p><var>response</var>'s <a for=response>type</a> is "<code>error</code>"
5251-
52525261
<li><p><var>request</var>'s <a for=request>mode</a> is "<code>same-origin</code>" and
52535262
<var>response</var>'s <a for=response>type</a> is "<code>cors</code>"
52545263

@@ -5262,8 +5271,7 @@ these steps:
52625271
<var>response</var>'s <a for=response>URL list</a> has more than one item.
52635272
</ul>
52645273

5265-
<p>then return the result of running <a>HTTPS upgrade fallback</a> given <var>request</var>
5266-
and a <a>network error</a>.
5274+
<p>then return a <a>network error</a>.
52675275
</ol>
52685276
</ol>
52695277

@@ -5330,15 +5338,15 @@ these steps:
53305338
<a>cross-origin resource policy check</a> with <var>request</var>'s <a for=request>origin</a>,
53315339
<var>request</var>'s <a for=request>client</a>, <var>request</var>'s
53325340
<a for=request>destination</a>, and <var>internalResponse</var> returns <b>blocked</b>, then
5333-
return the result of running <a>HTTPS upgrade fallback</a> given <var>request</var>
5334-
and a <a>network error</a>.
5341+
return a <a>network error</a>.
53355342

53365343
<p class=note>The <a>cross-origin resource policy check</a> runs for responses coming from the
53375344
network and responses coming from the service worker. This is different from the
53385345
<a>CORS check</a>, as <var>request</var>'s <a for=request>client</a> and the service worker can
53395346
have different embedder policies.
53405347

5341-
<li>Set <var>response</var> and <var>internalResponse</var> to the result of running
5348+
<li>If <var>request</var>'s <code>https-upgrade</code> flag is set, set <var>response</var> and
5349+
<var>internalResponse</var> to the result of running
53425350
<a>HTTPS upgrade fallback</a> given <var>request</var> and <var>response</var>.
53435351

53445352
<li>

0 commit comments

Comments
 (0)