Service Worker: Fix pathname issues (#3642)

This commit is contained in:
Alexander Zinchuk 2023-07-20 20:29:39 +02:00
parent cde0f8c5f8
commit 8835e215f5

View File

@ -56,17 +56,17 @@ self.addEventListener('fetch', (e: FetchEvent) => {
const { pathname, protocol } = new URL(url);
const { pathname: scopePathname } = new URL(scope);
if (pathname.startsWith('/progressive/')) {
if (pathname.includes('/progressive/')) {
e.respondWith(respondForProgressive(e));
return true;
}
if (pathname.startsWith('/download/')) {
if (pathname.includes('/download/')) {
e.respondWith(respondForDownload(e));
return true;
}
if (pathname.startsWith('/share/')) {
if (pathname.includes('/share/')) {
e.respondWith(respondForShare(e));
}