Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b41f6c7

Browse files
Add comment on Service-Worker-Allowed header
1 parent 899304e commit b41f6c7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎src/node/routes/index.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ export const register = async (app: App, args: DefaultedArgs): Promise<Disposabl
130130
cacheControl: commit !== "development",
131131
fallthrough: false,
132132
setHeaders: (res, path, stat) => {
133+
// The service worker is served from a sub-path on the static route so
134+
// this is required to allow it to register a higher scope (by default
135+
// the browser only allows it to register from its own path or lower).
133136
if (path.endsWith("/serviceWorker.js")) {
134137
res.setHeader("Service-Worker-Allowed", "/")
135138
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /