@@ -3270,7 +3270,7 @@ steps:
3270
3270
<li>
3271
3271
<p> If one or more of the following conditions are met, return without modifying request:
3272
3272
<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> "
3274
3274
3275
3275
<li><p><var> request</var> 's <a for="request">method</a> is not "<code> GET</code> "
3276
3276
@@ -3285,9 +3285,10 @@ steps:
3285
3285
</ul>
3286
3286
</li>
3287
3287
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.
3291
3292
3292
3293
<li><p> Otherwise, upgrade the request by setting the following fields:
3293
3294
<ul>
@@ -3300,20 +3301,26 @@ steps:
3300
3301
3301
3302
<h4 id=https-upgrades-fallback>Fallback algorithm</h4>
3302
3303
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>
3304
3305
<var> request</var> and <a for=/>response</a> <var> response</var> , run these steps:
3305
3306
3306
3307
<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.
3309
3312
3310
3313
<li>
3311
3314
<p> Otherwise, the request was upgraded.
3312
3315
3313
3316
<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>
3317
3324
3318
3325
<li><p> Otherwise, the upgrade was successful. Return <var> response</var> .
3319
3326
</ol>
@@ -5243,12 +5250,14 @@ these steps:
5243
5250
<a>filtered response</a> ; otherwise to <var> response</var> 's
5244
5251
<a for="filtered response">internal response</a> .
5245
5252
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
+
5246
5257
<li>
5247
5258
<p> If one of the following is true
5248
5259
5249
5260
<ul class=brief>
5250
- <li><p><var> response</var> 's <a for=response>type</a> is "<code> error</code> "
5251
-
5252
5261
<li><p><var> request</var> 's <a for=request>mode</a> is "<code> same-origin</code> " and
5253
5262
<var> response</var> 's <a for=response>type</a> is "<code> cors</code> "
5254
5263
@@ -5262,8 +5271,7 @@ these steps:
5262
5271
<var> response</var> 's <a for=response>URL list</a> has more than one item.
5263
5272
</ul>
5264
5273
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> .
5267
5275
</ol>
5268
5276
</ol>
5269
5277
@@ -5330,15 +5338,15 @@ these steps:
5330
5338
<a>cross-origin resource policy check</a> with <var> request</var> 's <a for=request>origin</a> ,
5331
5339
<var> request</var> 's <a for=request>client</a>, <var>request</var>' s
5332
5340
<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> .
5335
5342
5336
5343
<p class=note> The <a>cross-origin resource policy check</a> runs for responses coming from the
5337
5344
network and responses coming from the service worker. This is different from the
5338
5345
<a>CORS check</a> , as <var> request</var> 's <a for=request>client</a> and the service worker can
5339
5346
have different embedder policies.
5340
5347
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
5342
5350
<a>HTTPS upgrade fallback</a> given <var> request</var> and <var> response</var> .
5343
5351
5344
5352
<li>
0 commit comments