Skip to content

Conversation

@p-j
Copy link

@p-j p-j commented Nov 11, 2020

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 p-j force-pushed the feat/mock-cache-accept-only-cacheable branch 3 times, most recently from 3cd3cc0 to a87094d Compare November 11, 2020 23:38
@p-j p-j force-pushed the feat/mock-cache-accept-only-cacheable branch from a87094d to ad2a119 Compare November 11, 2020 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant