Removed joining "/" between origin and cache root

This commit is contained in:
Victor Westerlund 2020-12-14 08:18:30 +01:00
parent a81fc8f212
commit c6e4eab25f

View file

@ -61,7 +61,7 @@ self.addEventListener("fetch", event => {
// Get pattern.gif from generator. Fallback to cache on failure // Get pattern.gif from generator. Fallback to cache on failure
if(origin && url.pathname.endsWith("pattern.gif")) { if(origin && url.pathname.endsWith("pattern.gif")) {
const pattern = new Request(`${location.origin}/${root}assets/img/pattern.php`); const pattern = new Request(`${location.origin}${root}assets/img/pattern.php`);
event.respondWith( event.respondWith(
fetch(pattern).catch(() => { fetch(pattern).catch(() => {
return caches.match(event.request); return caches.match(event.request);