From ad9a84ad91fb6bd3a2dcdf0406321785f51c4c11 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Fri, 21 Aug 2020 23:56:20 +0900 Subject: [PATCH] Augment COEP violation report * Rename "blocked-url" to "blockedURL" (whatwg/html#5818). * Add "disposition" (whatwg/html#5391). * Add "destination" (whatwg/html#5391). --- fetch.bs | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/fetch.bs b/fetch.bs index d95c30c78..a317c5166 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3232,9 +3232,9 @@ Cross-Origin-Resource-Policy = %s"same-origin" / %s"same-site" / %s"cross-or

To perform a cross-origin resource policy check, given an origin -origin, an environment settings object settingsObject, a -response response, and an optional boolean forNavigation, run -these steps: +origin, an environment settings object settingsObject, a string +destination, a response response, and an optional boolean +forNavigation, run these steps:

  1. Set forNavigation to false if it is not given. @@ -3254,14 +3254,14 @@ these steps: embedderPolicy's report only value, response, and forNavigation returns blocked, then queue a cross-origin embedder policy CORP violation report with response, - settingsObject, and true. + settingsObject, destination, and true.

  2. If the cross-origin resource policy internal check with origin, embedderPolicy's value, response, and forNavigation returns allowed, then return allowed.

  3. Queue a cross-origin embedder policy CORP violation report with response, - settingsObject, and false. + settingsObject, destination, and false.

  4. Return blocked.

@@ -3341,7 +3341,8 @@ these steps:

To queue a cross-origin embedder policy CORP violation report, given a response response, an environment settings object -settingsObject, and a boolean reportOnly, run these steps: +settingsObject, a string destination, and a boolean reportOnly, +run these steps:

  1. Let endpoint be settingsObject's @@ -3350,10 +3351,13 @@ these steps: settingsObject's embedder policy's reporting endpoint otherwise. -

  2. Let serialized url be the result of +

  3. Let serializedURL be the result of serializing a response URL for reporting with response. +

  4. Let disposition be "reporting" if reportOnly is true; + otherwise "enforce". +

  5. Let body be a new object containing the following properties: @@ -3368,8 +3372,16 @@ these steps: "corp" - "blocked-url" - serialized url + "blockedURL" + serializedURL + + + "destination" + destination + + + "disposition" + disposition @@ -4130,8 +4142,9 @@ optional CORS-preflight flag, run these steps:

    If either request's response tainting or response's type is "opaque", and the cross-origin resource policy check with request's origin, - request's client, and actualResponse returns - blocked, then return a network error. + request's client, request's + destination, and actualResponse returns blocked, then return + a network error.

    The cross-origin resource policy check runs for responses coming from the network and responses coming from the service worker. This is different from the