From a14f2279f8ba471ab6028a484bf5f3d3ab40aed1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 25 Jul 2023 13:00:32 +0200 Subject: [PATCH 1/4] Add `"json"` destination, for JSON modules --- fetch.bs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/fetch.bs b/fetch.bs index 54aa2bd43..a3bf3ea30 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1725,6 +1725,7 @@ the empty string, "frame", "iframe", "image", +"json", "manifest", "object", "paintworklet", @@ -1744,7 +1745,7 @@ and "webidentity" as fetches with those destinations skip service w

A request's destination is @@ -2173,9 +2174,9 @@ bookkeeping details by the fetch algorithm.

A subresource request is a request whose destination is "audio", "audioworklet", -"font", "image", "manifest", "paintworklet", -"script", "style", "track", "video", -"xslt", or the empty string. +"font", "image", "json" "manifest", +"paintworklet", "script", "style", "track", +"video", "xslt", or the empty string.

A non-subresource request is a request whose destination is "document", "embed", @@ -4356,6 +4357,9 @@ the response. [[!HTTP-CACHING]]

"style"
`text/css,*/*;q=0.1` + +
"json" +
`application/json,*/*;q=0.5`
  • Append (`Accept`, value) to @@ -7390,7 +7394,7 @@ dictionary RequestInit { any window; // can only be set to null }; -enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" }; +enum RequestDestination { "", "audio", "audioworklet", "document", "embed", "font", "frame", "iframe", "image", "json", "manifest", "object", "paintworklet", "report", "script", "sharedworker", "style", "track", "video", "worker", "xslt" }; enum RequestMode { "navigate", "same-origin", "no-cors", "cors" }; enum RequestCredentials { "omit", "same-origin", "include" }; enum RequestCache { "default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached" }; From 450893f0ed1e99dd203adccac5c197c2adcbe9fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 25 Jul 2023 15:40:09 +0200 Subject: [PATCH 2/4] Review --- fetch.bs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index a3bf3ea30..a20ee067e 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1841,10 +1841,14 @@ not always relevant and might require different behavior. "worker" child-src, script-src, worker-src Worker + + "json" + connect-src + import "..." with { type: "json" } "style" style-src - HTML's <link rel=stylesheet>, CSS' @import + HTML's <link rel=stylesheet>, CSS' @import, import "..." with { type: "css" } "track" media-src @@ -4358,8 +4362,8 @@ the response. [[!HTTP-CACHING]]

    "style"
    `text/css,*/*;q=0.1` -
    "json" -
    `application/json,*/*;q=0.5` +
    "json" +
    `application/json,*/*;q=0.5`
  • Append (`Accept`, value) to From b58a8cc2d032d0a380dc5f6e1c669cb9962d709c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 25 Jul 2023 16:03:19 +0200 Subject: [PATCH 3/4] Fix CI error --- fetch.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fetch.bs b/fetch.bs index a20ee067e..607112c4f 100644 --- a/fetch.bs +++ b/fetch.bs @@ -1770,7 +1770,7 @@ not always relevant and might require different behavior. CSP directive Features - "" + "" "report" — CSP, NEL reports. From 5e686035b81f9388b9b21f92488d1c20997a9ca3 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Sun, 29 Oct 2023 13:04:31 -0700 Subject: [PATCH 4/4] sorting --- fetch.bs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fetch.bs b/fetch.bs index 607112c4f..2b304c4bd 100644 --- a/fetch.bs +++ b/fetch.bs @@ -4359,11 +4359,11 @@ the response. [[!HTTP-CACHING]]

    "image"
    `image/png,image/svg+xml,image/*;q=0.8,*/*;q=0.5` -
    "style" -
    `text/css,*/*;q=0.1` -
    "json"
    `application/json,*/*;q=0.5` + +
    "style" +
    `text/css,*/*;q=0.1`
  • Append (`Accept`, value) to