@@ -350,19 +350,27 @@ The following algorithm details these restrictions:
350
350
351
351
1 . Let <var >request</var > be the request that fetched
352
352
<var >resource</var >.
353
- 2 . If the [ mode] [ fetch-mode ] of <var >request</var > is ` CORS ` ,
353
+ 2 . If the [ response type] [ ] is ` opaque ` , return ` false ` .
354
+ 3 . If the [ mode] [ fetch-mode ] of <var >request</var > is ` CORS ` ,
354
355
return ` true ` .
355
- 3 . If the [ origin] [ fetch-origin ] of <var >request</var > is
356
+ 4 . If the [ origin] [ fetch-origin ] of <var >request</var > is
356
357
<var >resource</var >'s origin, return ` true ` .
357
- 4 . Return ` false ` .
358
+ 5 . Return ` false ` .
358
359
359
- Step 2 returns ` true ` if the fetch was a CORS-enabled request. If the
360
+ Step 3 returns ` true ` if the fetch was a CORS-enabled request. If the
360
361
fetch failed the CORS checks, it won't be available to us for integrity
361
362
checking because it won't have loaded successfully.
362
363
{:.note}
363
364
365
+ Since the [ response type] [ ] for data URLs will always be "opaque" for
366
+ ` script ` and ` link ` elements, such URLs are never eligible for integrity
367
+ checks. Blob URLs on the other hand are usually considered same-origin and
368
+ therefore are eligible for integrity checks.
369
+ {:.note}
370
+
364
371
[ fetch-mode ] : https://fetch.spec.whatwg.org/#concept-request-mode
365
372
[ fetch-origin ] : https://fetch.spec.whatwg.org/#concept-request-origin
373
+ [ response type ] : https://fetch.spec.whatwg.org/#concept-response-type
366
374
</section ><!-- Algorithms::eligible -->
367
375
<section >
368
376
#### Parse <var >metadata</var >.
0 commit comments