Re: [ServiceWorker] Service-Worker-Allowed header (#604)

> Suppose a site changes the Service-Worker-Allowed header after a worker installs. E.g., at install time it was "/" and later the site change it to "/restricted_path. What's the expected behavior? I would think upon "24 hour" update you re-evaluate the path restriction using the new max scope against the newest worker's script URL. 

Yes, for all the Update/Soft Update cases (ServiceWorkerContainer.register(), ServiceWorkerRegistration.update(), 24h update, navigation matching), the given registration's scope (NOT the script URL) is re-evaluated against the new max scope.

> If that fails, you terminate the workers and clear the registration. Does that make sense?

I think so as the site is trying to give it a new restriction upon those updates.

> The spec language needs some proofreading. I think "Let" and "Set" got mixed up in some places.

I double-checked and couldn't find misuse of those. Probably, the use of similar names, `maxScope` and `maxScopeString`, made the confusion?

---
Reply to this email directly or view it on GitHub:
https://github.com/slightlyoff/ServiceWorker/issues/604#issuecomment-70611744

Received on Tuesday, 20 January 2015 06:51:40 UTC