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
Workbox precaching network fallback cannot handle integrity #3096
Comments
Thanks for reporting this issue with the precaching fallback logic, when SRI is used. I can see two possible solutions:
The first solution offers the advantage of repairing the missing cache entry, but there are a couple of (perhaps trivial?) issues:
The second solution, to just not attempt to use SRI and repair the cache in that scenario, would be more backwards compatible and "safer". My inclination is to go with a minor change to implement the second approach to work around the immediate issue, and potentially implement the first approach in Workbox v7. @tropicadri, what are your thoughts? |
Thanks for the quick response and solutions. |
That's unexpected. The fallback workbox/packages/workbox-precaching/src/PrecacheStrategy.ts Lines 134 to 138 in 4e80b58
The intention behind passing in the network |
@jeffposnick actually I was wrong, the failed request was made by |
Thanks for confirming. So it sounds like the analysis in #3096 (comment) still applies. |
Library Affected:
workbox-precaching
Browser & Platform:
Google Chrome v103.0.5060.114 for Mac
Issue or Feature Request Description:
In service worker:
Way to reproduce:
workbox/packages/workbox-precaching/src/PrecacheStrategy.ts
Line 121 in 4e80b58
Potential fix: when integrity is used, it should use cors mode to fetch the resource
The text was updated successfully, but these errors were encountered: