From 5f15318bfe89d5a495b2a5fdaa24c84ee6b9154d Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Wed, 8 Apr 2026 03:23:36 +0000 Subject: [PATCH 1/2] Set request's initiator and destination to empty string in cache.addAll() (#1718) As pointed out in https://github.com/w3c/ServiceWorker/issues/1718, "fetch" is not a valid value for a request's initiator, and "subresource" is not a valid destination in the Fetch specification. Following the discussion in the issue, cache.addAll() should function the same as if a script ran fetch() directly. Therefore, both initiator and destination should be set to the empty string. This updates the Cache/addAll algorithm steps in the specification. Fixes #1718 --- index.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.bs b/index.bs index fd24a838..adb90da0 100644 --- a/index.bs +++ b/index.bs @@ -2099,7 +2099,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. [=list/For each=] |fetchController| of |fetchControllers|, [=fetch controller/abort=] |fetchController|. 1. Return [=a promise rejected with=] a `TypeError`. 1. If |r|'s [=request/client=]'s [=environment settings object/global object=] is a {{ServiceWorkerGlobalScope}} object, set |request|'s [=service-workers mode=] to "`none`". - 1. Set |r|'s [=request/initiator=] to "`fetch`" and [=request/destination=] to "`subresource`". + 1. Set |r|'s [=request/initiator=] and [=request/destination=] to the empty string. 1. Add |r| to |requestList|. 1. Let |responsePromise| be [=a new promise=]. 1. Run the following substeps [=in parallel=]: From 51a9972309ab006976e67dd1033c7c64151af141 Mon Sep 17 00:00:00 2001 From: Yoshisato Yanagisawa Date: Wed, 8 Apr 2026 21:19:41 +0900 Subject: [PATCH 2/2] Remove empty string assignment for request properties Remove setting initiator and destination to empty string. --- index.bs | 1 - 1 file changed, 1 deletion(-) diff --git a/index.bs b/index.bs index adb90da0..6c57470c 100644 --- a/index.bs +++ b/index.bs @@ -2099,7 +2099,6 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/ 1. [=list/For each=] |fetchController| of |fetchControllers|, [=fetch controller/abort=] |fetchController|. 1. Return [=a promise rejected with=] a `TypeError`. 1. If |r|'s [=request/client=]'s [=environment settings object/global object=] is a {{ServiceWorkerGlobalScope}} object, set |request|'s [=service-workers mode=] to "`none`". - 1. Set |r|'s [=request/initiator=] and [=request/destination=] to the empty string. 1. Add |r| to |requestList|. 1. Let |responsePromise| be [=a new promise=]. 1. Run the following substeps [=in parallel=]: