1
0
This commit is contained in:
Zef Hemel 2023-07-07 09:28:20 +02:00
parent 820638f79f
commit 59ff0643b0

View File

@ -97,11 +97,11 @@ self.addEventListener("fetch", (event: any) => {
return fetch(request);
}
// If this is a /*.* request, this can either be a plug worker load or an attachment load
if (/\/.+\.[a-zA-Z]+$/.test(pathname)) {
return handleLocalFileRequest(request, pathname);
} else if (pathname === "/.auth") {
if (pathname === "/.auth" || pathname === "/index.json") {
return fetch(request);
} else if (/\/.+\.[a-zA-Z]+$/.test(pathname)) {
// If this is a /*.* request, this can either be a plug worker load or an attachment load
return handleLocalFileRequest(request, pathname);
} else {
// Must be a page URL, let's serve index.html which will handle it
return (await caches.match(precacheFiles["/"])) || fetch(request);