[ServiceWorker] Document the headers being introduced (#717)

Currently, the ABNF of both the 'Service-Worker' and 'Service-Worker-Allowed' headers are undocumented, as are the contents.

Concretely:
- Review [RFC 7231, Section 8.3](http://tools.ietf.org/html/rfc7231#section-8.3) for considerations when registering new header fields
- Review [BCP 90](http://tools.ietf.org/html/rfc3864) for the technical requirements (cc @mnot )
- Add language for both `Service-Worker` and `Service-Worker-Allowed`
  - From the spec, it would appear that `Service-Worker` is a request header, whose syntax is [token](https://tools.ietf.org/html/rfc7230#section-3.2.6), and in practice whose value is `script` (but I don't think the ABNF should be so restrictive; leave that for prose)
  - From Chrome's implementation (but unspecified in the spec), it would appear that `Service-Worker-Allowed` is a response header, whose syntax is either [URI-reference](https://tools.ietf.org/html/rfc3986#section-4.1) or, due to the fact that it should only contain a path relative to the same origin (scheme/authority) or is [path](https://tools.ietf.org/html/rfc3986#section-3.3) - although it's unclear whether this is supposed to be path-abempty (is "Service-Worker-Allowed: " a valid header? Chrome appears to allowed this, counter-intuitively), path-absolute (does "Service-Worker-Allowed: " always require a leading /? Chrome's implementation appears to resolve it as a relative URL, and thus doesn't require this), path-noscheme (doesn't seem to fit at all), or path-rootless (prohibits absolute). My gut from the spec is that it's probably meant to be path-absolute, although I'm not sure if @annevk has better language.
- Update `maxScope` to be the result of **resolving** the URL relative to the document's _registering script url_, since it incorrectly refers to being the result of **parsing** serviceWorkerAllowed, which is incorrect, since serviceWorkerAllowed is already parsed (presumably, as a URL)

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

Received on Tuesday, 23 June 2015 16:52:31 UTC