To perform a cross-origin resource policy check, given a request and -response, run these steps:
+To perform a cross-origin resource policy internal check, given a string +embedder policy value, a request request and +a response response, run these steps:
If request's mode is not "no-cors
", then return
- allowed.
+
Assert: request's mode is "navigate
" or
+ "no-cors
".
If request's origin is same origin with - request's current URL's origin, then return - allowed. +
If request's mode is "navigate
":
-
While redirects that carry a
- `Cross-Origin-Resource-Policy
` header are checked, redirects
- without such a header resulting in response do not affect the outcome as the default is
- allowed.
-
+
Only HTML's navigate algorithm uses this check for the
+ "navigate
" mode, for nested navigations. [[!HTML]]
+
+
Assert: request is for a nested navigation. + +
Fix this assertion when + #948 is merged. + +
If embedder policy value is "unsafe-none
", then return
+ allowed.
+
Let policy be the result of getting @@ -3189,34 +3196,113 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or header list.
This means that `Cross-Origin-Resource-Policy: same-site, same-origin
`
- ends up as allowed below as it will never match anything. Two or more
+ ends up as allowed below as it will never match anything, as long as
+ embedder policy value is "unsafe-none
". Two or more
`Cross-Origin-Resource-Policy
` headers will have the same effect.
-
If policy is `same-origin
`, then return blocked.
+
If policy is null and embedder policy value is
+ "require-corp
", then set policy to "same-origin
".
If the following are true +
Switch on policy: -
https
" or response's HTTPS state is
- "none
"
- cross-origin
"
+ Return allowed. -
then return allowed. +
same-origin
"
+ If request's origin is same origin with + request's current URL's origin, then return + allowed. -
This prevents HTTPS responses with
- `Cross-Origin-Resource-Policy: same-site
` from being accessed without secure
- transport.
+
Otherwise, return blocked. -
If policy is `same-site
`, then return blocked.
+
same-site
"
+ If the following are true -
Return allowed. +
request's origin is schemelessly same site with + request's current URL's origin + +
request's origin's scheme is
+ "https
" or response's HTTPS state is
+ "none
"
+
then return allowed. + +
Otherwise, return blocked. + +
`Cross-Origin-Resource-Policy: same-site
` does not consider a
+ response delivered via a secure transport to match a non-secure requesting origin,
+ even if their hosts are otherwise same site. Securely-transported responses will only
+ match a securely-transported initiator.
+
To queue a cross-origin embedder policy CORP violation report, given a request +request and a string reporting endpoint, run these steps: + +
Let serialized url be the result of + serializing a request URL for reporting with + request. + +
Let body be a new object containing the following properties: + +
key + | value + | + +
---|---|
"type "
+ | "corp "
+ |
"blocked-url "
+ | serialized url + |
Queue body as
+ "coep
" for reporting endpoint on request's
+ client. [[!REPORTING]]
To perform a cross-origin resource policy check, given a request +request and a response response, run these steps:
+Let embedder policy be request's client's + embedder policy. + +
If the cross-origin resource policy internal check with "unsafe-none
",
+ request and response returns blocked, then return blocked.
+
+
This is to queue only COEP related violation reports. + +
If the cross-origin resource policy internal check with embedder policy's + report only value, request and response returns blocked, then + queue a cross-origin embedder policy CORP violation report with + request and embedder policy's report only reporting endpoint. + +
If the cross-origin resource policy internal check with + embedder policy's value, request and response returns + allowed, then return allowed. + +
Queue a cross-origin embedder policy CORP violation report with request + and embedder policy's reporting endpoint. + +
Return blocked. +
follow
" and
response's URL list has more than one item.
+
+ request's response tainting is "opaque
" and
+ the cross-origin resource policy check with request and response
+ returns blocked.
then return a network error. @@ -4533,7 +4623,7 @@ Range Requests. [[HTTP-RANGE]] However, this is not widely supported by b
If httpRequest's header list contains
`Range
`, then set response's range-requested flag.
-
If httpRequest's response tainting is not "cors
"
+
If httpRequest's response tainting is "opaque
"
and the cross-origin resource policy check with request and response
returns blocked, then return a network error.