mirror of
https://github.com/kevin-DL/sapper-template.git
synced 2026-01-12 10:25:16 +00:00
Merge pull request #9 from mathiasbynens/patch-2
Use `startsWith` instead of a regular expression
This commit is contained in:
@@ -37,7 +37,7 @@ self.addEventListener('fetch', event => {
|
||||
const url = new URL(event.request.url);
|
||||
|
||||
// don't try to handle e.g. data: URIs
|
||||
if (!/^https?/.test(url.protocol)) return;
|
||||
if (!url.protocol.startsWith('http')) return;
|
||||
|
||||
// always serve assets and webpack-generated files from cache
|
||||
if (cached.has(url.pathname)) {
|
||||
|
||||
Reference in New Issue
Block a user