Add trailing slash to service worker scope
This will ensure it always matches or is underneath the allowed service worker scope. Fixes #2076.
This commit is contained in:
parent
fef619aef8
commit
938b460685
@ -10,7 +10,7 @@ if ("serviceWorker" in navigator) {
|
||||
const path = normalize(`${options.csStaticBase}/dist/serviceWorker.js`)
|
||||
navigator.serviceWorker
|
||||
.register(path, {
|
||||
scope: options.base || "/",
|
||||
scope: (options.base ?? "") + "/",
|
||||
})
|
||||
.then(() => {
|
||||
console.log("[Service Worker] registered")
|
||||
|
Loading…
Reference in New Issue
Block a user