未验证 提交 938b4606 编写于 作者: A Asher

Add trailing slash to service worker scope

This will ensure it always matches or is underneath the allowed service
worker scope.

Fixes #2076.
上级 fef619ae
......@@ -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")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册