service-workers icon indicating copy to clipboard operation
service-workers copied to clipboard

Request cacheability follow the spec

Open p-j opened this issue 4 years ago • 0 comments

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.

p-j avatar Nov 11 '20 23:11 p-j