From 160c7ecce9f4f6330dd5c2e26ef1c331f0514fbb Mon Sep 17 00:00:00 2001 From: Mike West Date: Fri, 10 Jan 2020 09:03:08 +0100 Subject: [PATCH 1/5] Integrate with Fetch Metadata. This patch integrates Fetch Metadata processing into Fetch's "main fetch" algorithm, and defines a "user activation flag" on requests that will be populated during HTML's "process a navigate fetch" algorithm. Closes #885. --- fetch.bs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fetch.bs b/fetch.bs index 4cab33292..279c67d3b 100644 --- a/fetch.bs +++ b/fetch.bs @@ -120,6 +120,7 @@ specifications:
  • Redirects
  • Cross-origin semantics
  • CSP [[!CSP]] +
  • Fetch Metadata [[!FETCH-METADATA]]
  • Service workers [[!SW]]
  • Mixed Content [[!MIX]]
  • `Referer` [[!REFERRER]] @@ -1555,6 +1556,10 @@ Unless stated otherwise, it is unset.

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +

    A request has an associated +user-activation flag. Unless +stated otherwise, it is unset. +


    A request has an associated @@ -3335,6 +3340,9 @@ optionally with a recursive flag, run these steps:

  • Upgrade request to a potentially secure URL, if appropriate. [[!UPGRADE]] +

  • Set the Fetch metadata headers for request. + [[!FETCH-METADATA]] +

  • If should fetching request be blocked due to a bad port, should fetching request be blocked as mixed content, From ab1d7b0fec085b24ea0af64c36ea917fed0646a1 Mon Sep 17 00:00:00 2001 From: Mike West Date: Tue, 11 Feb 2020 07:45:47 +0100 Subject: [PATCH 2/5] fixup bikeshedding --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index 0c5aff4b3..4281de5f3 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3340,7 +3340,7 @@ optionally with a recursive flag, run these steps:

  • Upgrade request to a potentially secure URL, if appropriate. [[!UPGRADE]] -

  • Set the Fetch metadata headers for request. +

  • Set the Fetch metadata headers for request. [[!FETCH-METADATA]]

  • If From 58d9d1870d9adc2bd348033c3bf897fe38729ae2 Mon Sep 17 00:00:00 2001 From: Mike West Date: Tue, 2 Mar 2021 13:26:34 +0100 Subject: [PATCH 3/5] fixup move integration to HTTP-network-or-cache fetch --- fetch.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index f94b82833..af07f211e 100644 --- a/fetch.bs +++ b/fetch.bs @@ -3374,9 +3374,6 @@ steps:

  • Upgrade request to a potentially secure URL, if appropriate. [[!UPGRADE]] -

  • Set the Fetch metadata headers for request. - [[!FETCH-METADATA]] -

  • If should request be blocked due to a bad port, should fetching request be blocked as mixed content, or @@ -4211,6 +4208,9 @@ steps. They return a response.

  • Append a request `Origin` header for httpRequest. +

  • Set the Fetch metadata + headers for request. [[!FETCH-METADATA]] +

  • If httpRequest's header list does not contain `User-Agent`, then user agents should append From c0050629590f01932fcaf4931699705c54029daa Mon Sep 17 00:00:00 2001 From: Mike West Date: Tue, 2 Mar 2021 15:32:39 +0100 Subject: [PATCH 4/5] fixup annevk's feedback --- fetch.bs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index af07f211e..5e97b6d80 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1662,9 +1662,11 @@ Unless stated otherwise, it is unset.

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] -

    A request has an associated -user-activation flag. Unless -stated otherwise, it is unset. +

    A request has an associated boolean +user-activation. Unless +stated otherwise, it is false. + +

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]]


    @@ -4208,8 +4210,8 @@ steps. They return a response.
  • Append a request `Origin` header for httpRequest. -

  • Set the Fetch metadata - headers for request. [[!FETCH-METADATA]] +

  • Append the Fetch + metadata headers for httpRequest. [[!FETCH-METADATA]]

  • If httpRequest's header list does not contain `User-Agent`, then user agents should From b36a125b0675bc8273c39d12feacc868e1861d58 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Thu, 4 Mar 2021 09:13:44 +0100 Subject: [PATCH 5/5] nits --- fetch.bs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/fetch.bs b/fetch.bs index 5e97b6d80..f90dd8789 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1654,19 +1654,18 @@ a given context. [[!CSP]] reload-navigation flag. Unless stated otherwise, it is unset. -

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]]

    A request has an associated history-navigation flag. Unless stated otherwise, it is unset. -

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] -

    A request has an associated boolean -user-activation. Unless -stated otherwise, it is false. +

    A request has an associated boolean user-activation. +Unless stated otherwise, it is false. -

    This flag is for exclusive use by HTML's navigate algorithm. [[!HTML]] +

    This is for exclusive use by HTML's navigate algorithm. [[!HTML]]


    @@ -4210,8 +4209,8 @@ steps. They return a response.
  • Append a request `Origin` header for httpRequest. -

  • Append the Fetch - metadata headers for httpRequest. [[!FETCH-METADATA]] +

  • Append the Fetch metadata headers for httpRequest. + [[!FETCH-METADATA]]

  • If httpRequest's header list does not contain `User-Agent`, then user agents should