From b6da9304d36f26ed1c385894af7f4bff3a21f1f3 Mon Sep 17 00:00:00 2001 From: Antonio Sartori Date: Thu, 6 May 2021 10:07:41 +0200 Subject: [PATCH 1/4] Add policy container to request --- fetch.bs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fetch.bs b/fetch.bs index 30dceaceb..b2f22fd1c 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1519,6 +1519,14 @@ user-agent-defined object). Unless otherwise stated it is null. fetching. It provides a convenient way for standards to not have to set request's origin. +

A request has an associated policy container, which is "client" or a policy container. Unless stated otherwise it is "client". + +

"client" is changed to a policy container +during fetching. It provides a convenient way for standards to not have to set +request's policy container. +

A request has an associated referrer, which is "no-referrer", "client", or a URL. Unless stated otherwise it @@ -3659,6 +3667,19 @@ steps: current URL is not local, then set response to a network error. +

  • +

    If request's policy container is "client", then: + +

      +
    1. If request's client is non-null, then set + request's policy container to a clone of request's client's policy container. [[!HTML]] + +

    2. Else, set request's policy container to a new policy container. +

    +
  • Run report Content Security Policy violations for request.

  • Upgrade request to a potentially trustworthy URL, if appropriate. From 7ede7256eb910f0df0d2a2df45bb25f8cd2a16c5 Mon Sep 17 00:00:00 2001 From: Antonio Sartori Date: Thu, 6 May 2021 11:33:03 +0200 Subject: [PATCH 2/4] Fix --- fetch.bs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fetch.bs b/fetch.bs index b2f22fd1c..2d1d1873a 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1523,9 +1523,9 @@ user-agent-defined object). Unless otherwise stated it is null. id=concept-request-policy-container>policy container, which is "client" or a policy container. Unless stated otherwise it is "client". -

    "client" is changed to a policy container -during fetching. It provides a convenient way for standards to not have to set -request's policy container. +

    "client" is changed to a policy container during fetching. It provides a convenient way for standards to not have to set request's policy container.

    A request has an associated referrer, which is @@ -3676,7 +3676,7 @@ steps: lt="clone a policy container">clone of request's client's policy container. [[!HTML]] -

  • Else, set request's policy container to a new

    Otherwise, set request's policy container to a new policy container. From b54e56da7f3088e57ba1d605d0d003b6bc989271 Mon Sep 17 00:00:00 2001 From: Antonio Sartori Date: Thu, 6 May 2021 13:25:06 +0200 Subject: [PATCH 3/4] Rewrap --- fetch.bs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index 2d1d1873a..8864e99e6 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1519,9 +1519,10 @@ user-agent-defined object). Unless otherwise stated it is null. fetching. It provides a convenient way for standards to not have to set request's origin. -

    A request has an associated policy container, which is "client" or a policy container. Unless stated otherwise it is "client". +

    A request has an associated +policy container, which is +"client" or a policy container. Unless stated otherwise it is +"client".

    "client" is changed to a policy container during fetching. It provides a convenient way for standards to not have to set Date: Mon, 10 May 2021 12:28:29 +0200 Subject: [PATCH 4/4] more rewrapping and move defaulting out of main fetch (no need to run the conditional on each redirect) --- fetch.bs | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fetch.bs b/fetch.bs index 8864e99e6..b4a739e6e 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1524,9 +1524,9 @@ user-agent-defined object). Unless otherwise stated it is null. "client" or a policy container. Unless stated otherwise it is "client". -

    "client" is changed to a policy container during fetching. It provides a convenient way for standards to not have to set request's policy container. +

    "client" is changed to a policy container during +fetching. It provides a convenient way for standards to not have to set +request's policy container.

    A request has an associated referrer, which is @@ -3596,6 +3596,19 @@ the request. request's origin to request's client's origin. +

  • +

    If request's policy container is "client", then: + +

      +
    1. If request's client is non-null, then set + request's policy container to a + clone of request's client's + policy container. [[!HTML]] + +

    2. Otherwise, set request's policy container to a new + policy container. +

    +
  • If request's header list does not contain `Accept`, then: @@ -3668,19 +3681,6 @@ steps: current URL is not local, then set response to a network error. -

  • -

    If request's policy container is "client", then: - -

      -
    1. If request's client is non-null, then set - request's policy container to a clone of request's client's policy container. [[!HTML]] - -

    2. Otherwise, set request's policy container to a new policy container. -

    -
  • Run report Content Security Policy violations for request.

  • Upgrade request to a potentially trustworthy URL, if appropriate.