@@ -2437,6 +2437,63 @@ run these steps:</p>
2437
2437
</ol>
2438
2438
2439
2439
2440
+ <h3 id=cross-origin-resource-policy-header>`<code>Cross-Origin-Resource-Policy</code>` header</h3>
2441
+
2442
+ <p> The
2443
+ `<dfn export http-header id=http-cross-origin-resource-policy><code>Cross-Origin-Resource-Policy</code></dfn> `
2444
+ response <a for=/>header</a> can be used to require checking a <a for=/>request</a> 's
2445
+ <a for=request>current url</a> 's <a for=URL>origin</a> against a <a for=/>request</a>' s
2446
+ <a for=request>origin</a> when <a for=/>request</a> 's <a for=request>mode</a> is
2447
+ "<code> no-cors</code> ".
2448
+
2449
+ <p> Its <a for=header>value</a> <a>ABNF</a> :
2450
+
2451
+ <pre>
2452
+ Cross-Origin-Resource-Policy = %x73.61.6D.65 / %x73.61.6D.65.2D.73.69.74.65 ; "same" / "same-site"; case-sensitive</pre>
2453
+
2454
+ <p> To perform a <dfn>cross-origin resource policy check</dfn> , given a <var> request</var> and
2455
+ <var> response</var> , run these steps:</p>
2456
+
2457
+ <ol>
2458
+ <li><p> If <var> request</var> 's <a for=request>mode</a> is not "<code> no-cors</code> ", then return
2459
+ <b> allowed</b> .
2460
+
2461
+ <li>
2462
+ <p> If <var> request</var> 's <a for=request>origin</a> is <a>same origin</a> with
2463
+ <var> request</var> 's <a for=request>current url</a>' s <a for=URL>origin</a> , then return
2464
+ <b> allowed</b> .
2465
+
2466
+ <p class=note> A cross-origin response redirecting to a same or same-site resource with the
2467
+ `<code header> Cross-Origin-Resource-Policy</code> ` header specified does not affect anything.
2468
+ <!-- We could make this have an effect if we fix https://github.com/whatwg/fetch/pull/594 first,
2469
+ but even then we normally do not let this have any effect for "no-cors" so it would be
2470
+ somewhat inconsistent if it did here, but might still be better... -->
2471
+
2472
+ <li><p> Let <var> policy</var> be the <a>combined value</a> with
2473
+ `<code header> Cross-Origin-Resource-Policy</code> ` and <var> response</var> 's
2474
+ <a for=response>header list</a> .
2475
+
2476
+ <li><p> If <var> policy</var> is `<code> same</code> `, then return <b> blocked</b> .
2477
+
2478
+ <li>
2479
+ <p> If <var> policy</var> is `<code> same-site</code> ` and neither of the following is true
2480
+
2481
+ <ul class=brief>
2482
+ <li><p><var> request</var> 's <a for=request>origin</a>' s <a for=origin>host</a>
2483
+ <a>is a registrable domain suffix of or is equal to</a> <var> request</var> 's
2484
+ <a for=request>current url</a> 's <a for=URL>host</a>
2485
+
2486
+ <li><p><var> request</var> 's <a for=request>current url</a>' s <a for=URL>host</a>
2487
+ <a>is a registrable domain suffix of or is equal to</a> <var> request</var> 's
2488
+ <a for=request>origin</a> 's <a for=origin>host</a>
2489
+ </ul>
2490
+
2491
+ <p> then return <b> blocked</b>
2492
+
2493
+ <li><p> Return <b> allowed</b> .
2494
+ </ol>
2495
+
2496
+
2440
2497
2441
2498
<h2 id=fetching>Fetching</h2>
2442
2499
@@ -3736,6 +3793,9 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
3736
3793
</ol>
3737
3794
</ol>
3738
3795
3796
+ <li><p> If the <a>cross-origin resource policy check</a> with <var> request</var> and
3797
+ <var> response</var> returns <b> blocked</b> , then return a <a>network error</a> .
3798
+
3739
3799
<li>
3740
3800
<p> If <var> response</var> 's <a for=response>status</a> is <code> 401</code> , <i> CORS flag</i>
3741
3801
is unset, <i> credentials flag</i> is set, and <var> request</var> 's <a for=request>window</a> is an
@@ -6366,6 +6426,7 @@ Jeffrey Yasskin,
6366
6426
Jesse M. Heines,
6367
6427
Jinho Bang,
6368
6428
Jochen Eisinger,
6429
+ John Wilander,
6369
6430
Jonas Sicking,
6370
6431
Jonathan Kingston,
6371
6432
Jonathan Watt,
0 commit comments