service-workers
service-workers copied to clipboard
Request cacheability follow the spec
Relevant spec part: https://w3c.github.io/ServiceWorker/#cache-addAll
If r’s url's scheme is not one of "http" and "https", or r’s method is not
GET
, return a promise rejected with a TypeError.
Not all requests can be added to the cache, only GET over HTTP or HTTPS can be. This PR add a function to check for the "cacheability" of a request and throw the appropriate error if not. I've added tests for this PR but I haven't fixed the already broken ones.