Skip to content

Commit

Permalink
Ensure "race-network-and-fetch-handler" is used with a fetch handler
Browse files Browse the repository at this point in the history
As covered in https://github.com/WICG/service-worker-static-routing-api?tab=readme-ov-file#how-does-it-work-if-there-is-no-fetch-handler, the fetch handler must exists not only for the "fetch-handler" source but also the "race-network-and-fetch-handler" source.  The "race-network-and-fetch-handler" source was not written in the last update.
  • Loading branch information
yoshisatoyanagisawa committed May 31, 2024
1 parent 5408e2e commit 96e4795
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ spec: storage; urlPrefix: https://storage.spec.whatwg.org/
1. For each |rule| of |rules|:
1. If running the [=Verify Router Condition=] algorithm with |rule|["{{RouterRule/condition}}"] and |serviceWorker| returns false, return [=a promise rejected with=] a {{TypeError}}.
1. Append |rule| to |routerRules|.
1. If |routerRules| [=list/contains=] a {{RouterRule}} whose {{RouterRule/source}} is "{{RouterSourceEnum/fetch-event}}" and |serviceWorker|'s [=set of event types to handle=] does not [=set/contain=] {{ServiceWorkerGlobalScope/fetch!!event}}, return [=a promise rejected with=] a {{TypeError}}.
1. If |routerRules| [=list/contains=] a {{RouterRule}} whose {{RouterRule/source}} is either of "{{RouterSourceEnum/fetch-event}}" or "{{RouterSourceEnum/race-network-and-fetch-handler}}", and |serviceWorker|'s [=set of event types to handle=] does not [=set/contain=] {{ServiceWorkerGlobalScope/fetch!!event}}, return [=a promise rejected with=] a {{TypeError}}.
1. Set |serviceWorker|'s [=service worker/list of router rules=] to |routerRules|.
1. Return [=a promise resolved with=] undefined.

Expand Down

0 comments on commit 96e4795

Please sign in to comment.