From cc7b5af076d21d298b312e9b0df24c16aef55980 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Thu, 20 Aug 2020 15:18:42 +0900 Subject: [PATCH 1/3] Augment COEP violation report - "blocked-url" is renamed to "blockedURL" (whatwg/html#5818). - Added "disposition" (whatwg/html#5391). - Added "destination" (whatwg/html#5391). The CORP check now takes "destination" as a parameter. --- fetch.bs | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/fetch.bs b/fetch.bs index d95c30c78..9537ce197 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, + and "enforce" otherwise. +

  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 From e3e6703dec8f70bdbe0244e4d51ace7d9c8a4c53 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Thu, 20 Aug 2020 15:32:01 +0900 Subject: [PATCH 2/3] fix --- fetch.bs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 9537ce197..7f3befbcb 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4142,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 From 363054f312c5b7589bc4b47b74360c6d1b8f7835 Mon Sep 17 00:00:00 2001 From: Yutaka Hirano Date: Fri, 21 Aug 2020 18:36:58 +0900 Subject: [PATCH 3/3] Update fetch.bs Co-authored-by: Anne van Kesteren --- fetch.bs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fetch.bs b/fetch.bs index 7f3befbcb..a317c5166 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3355,8 +3355,8 @@ run these steps: serializing a response URL for reporting with response. -

  6. Let disposition be "reporting" if reportOnly is true, - and "enforce" otherwise. +

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

  8. Let body be a new object containing the following properties: