mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
web: keep the PWA's SPA fallback away from the gateway's /api/ pages
With UI and gateway on one origin, the service worker answered a navigation to /api/store/admin with index.html, so the moderation page opened the client instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
ddc7ce5dec
commit
a9f0586b88
1 file changed
+5
@@ -95,6 +95,11 @@ export default defineConfig({
|
||||
// ignores non-GET and non-http(s) requests (ws:// isn't touched), so
|
||||
// no extra runtimeCaching exclusions are needed here.
|
||||
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff2}'],
|
||||
// The SPA fallback answers every navigation with index.html — except
|
||||
// the gateway's own pages under /api/ (e.g. /api/store/admin), which
|
||||
// would otherwise open the client instead when UI and gateway share
|
||||
// an origin.
|
||||
navigateFallbackDenylist: [/^\/api\//],
|
||||
},
|
||||
}),
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user