Skip to content

Request cacheability follow the spec #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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