Skip to content

Commit a2fd262

Browse files
committed
address review comments
1 parent 7ee7a08 commit a2fd262

File tree

1 file changed

+20
-25
lines changed

1 file changed

+20
-25
lines changed

fetch.bs

+20-25
Original file line numberDiff line numberDiff line change
@@ -2467,7 +2467,7 @@ response <a for=/>header</a> can be used to require checking a <a for=/>request<
24672467
<p>Its <a for=header>value</a> <a>ABNF</a>:
24682468

24692469
<pre>
2470-
Cross-Origin-Resource-Policy = %x73.61.6D.65 / %x73.61.6D.65.2D.73.69.74.65 ; "same" / "same-site"; case-sensitive</pre>
2470+
Cross-Origin-Resource-Policy = %x73.61.6D.65 / %x73.61.6D.65.2D.73.69.74.65 ; "same" / "same-site", case-sensitive</pre>
24712471

24722472
<p>To perform a <dfn>cross-origin resource policy check</dfn>, given a <var>request</var> and
24732473
<var>response</var>, run these steps:</p>
@@ -2481,33 +2481,27 @@ Cross-Origin-Resource-Policy = %x73.61.6D.65 / %x73.61.6D.65.2D.73.69.74.65
24812481
<var>request</var>'s <a for=request>current url</a>'s <a for=url>origin</a>, then return
24822482
<b>allowed</b>.
24832483

2484-
<p class=note>A cross-origin response redirecting to a same or same-site resource with the
2485-
`<a http-header><code>Cross-Origin-Resource-Policy</code></a>` header specified does not affect
2486-
anything.
2487-
<!-- We could make this have an effect if we fix https://github.com/whatwg/fetch/pull/594 first,
2488-
but even then we normally do not let this have any effect for "no-cors" so it would be
2489-
somewhat inconsistent if it did here, but might still be better... -->
2490-
2491-
<li><p>Let <var>policy</var> be the <a>combined value</a> with
2492-
`<a http-header><code>Cross-Origin-Resource-Policy</code></a>` and <var>response</var>'s
2493-
<a for=response>header list</a>.
2494-
2495-
<li><p>If <var>policy</var> is `<code>same</code>`, then return <b>blocked</b>.
2484+
<p class="note no-backref">A cross-origin response redirecting to a response that is
2485+
<a>same origin</a> or <a>same site</a> with the initial request and has a
2486+
`<a http-header><code>Cross-Origin-Resource-Policy</code></a>` header specified, does not affect
2487+
anything. I.e., <var>request</var>'s <a for=request>tainted origin flag</a> is not checked.
24962488

24972489
<li>
2498-
<p>If <var>policy</var> is `<code>same-site</code>` and neither of the following is true
2490+
<p>Let <var>policy</var> be the <a>combined value</a> with
2491+
`<a http-header><code>Cross-Origin-Resource-Policy</code></a>` and <var>response</var>'s
2492+
<a for=response>header list</a>.
24992493

2500-
<ul class=brief>
2501-
<li><p><var>request</var>'s <a for=request>origin</a>'s <a for=origin>host</a>
2502-
<a>is a registrable domain suffix of or is equal to</a> <var>request</var>'s
2503-
<a for=request>current url</a>'s <a for=url>host</a>
2494+
<p class=note>This means that `<code>Cross-Origin-Resource-Policy: same-site, same</code>` ends up
2495+
as <b>allowed</b> below as it will never match anything. Two or more
2496+
`<a http-header><code>Cross-Origin-Resource-Policy</code></a>` headers will have the same effect.
25042497

2505-
<li><p><var>request</var>'s <a for=request>current url</a>'s <a for=url>host</a>
2506-
<a>is a registrable domain suffix of or is equal to</a> <var>request</var>'s
2507-
<a for=request>origin</a>'s <a for=origin>host</a>
2508-
</ul>
2498+
<li><p>If <var>policy</var> is `<code>same</code>`, then return <b>blocked</b>.
25092499

2510-
<p>then return <b>blocked</b>
2500+
<li><p>If <var>request</var>'s <a for=request>origin</a>'s <a for=url>host</a> is <a>same site</a>
2501+
with <var>request</var>'s <a for=request>current url</a>'s <a for=url>host</a>, then return
2502+
<b>allowed</b>.
2503+
2504+
<li><p>If <var>policy</var> is `<code>same-site</code>`, then return <b>blocked</b>.
25112505

25122506
<li><p>Return <b>allowed</b>.
25132507
</ol>
@@ -3809,8 +3803,9 @@ Range Requests</cite>. [[HTTP-RANGE]] However, this is not widely supported by b
38093803
</ol>
38103804
</ol>
38113805

3812-
<li><p>If the <a>cross-origin resource policy check</a> with <var>request</var> and
3813-
<var>response</var> returns <b>blocked</b>, then return a <a>network error</a>.
3806+
<li><p>If the <i>CORS flag</i> is unset and the <a>cross-origin resource policy check</a> with
3807+
<var>request</var> and <var>response</var> returns <b>blocked</b>, then return a
3808+
<a>network error</a>.
38143809

38153810
<li>
38163811
<p>If <var>response</var>'s <a for=response>status</a> is <code>401</code>, <i>CORS flag</i>

0 commit comments

Comments
 (0)