fix(sw): skip caching non-http/https requests

This commit is contained in:
Julien Calixte
2026-03-23 22:26:56 +01:00
parent 974f2ea326
commit 075c621614

View File

@@ -16,6 +16,9 @@ self.addEventListener('activate', e => {
self.addEventListener('fetch', e => {
const url = new URL(e.request.url);
// Only handle http/https requests
if (url.protocol !== 'http:' && url.protocol !== 'https:') return;
// Pass through API calls
if (url.pathname === '/extract-audio') return;