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

> [1]. We don't unregister in any other case, like MIME type changed or response code became 403, etc. Maybe it's more consistent to not unregister here then?
> [4]. An invalid Service-Worker-Allowed value does not uninstall. Only a valid one that no longer satisfies path restriction does. That seems a bit strange, intended?

Agreed. Let's keep it more consistent to other cases (i.e. not unregister.) Yes, it's a SecurityError so we stop updating it right here but the one already installed had had a permission to do so then. If authors wanted to unregister this, they should explicitly do so.

> [2]. I think the header value should be relative to the script URL (the HTTP request URL), rather than the client's base URL. That's how Content-Location and Referer works. WDYT?

Good catch. If we parse it against the client's base URL, the value would change based on the document locations in which the methods are invoked. Will fix this.

> [3]. Shouldn't an invalid Service-Worker-Allowed value be a SecurityError rather than a NetworkError?

It's aligned to Fetch spec. A header *parsing failure* leads to a network error there.

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

Received on Thursday, 22 January 2015 02:05:52 UTC