Commit 02d885d
fix: Stop service worker hijacking non-root paths
The CRA navigation fallback served the precached app shell for every
extension-less path, so https://gpu.rocks/api/ (the API reference) and
deep links like /benchmark rendered the homepage for any visitor with
the service worker installed — the HashRouter then rewrote the URL to
/api/#/, matching the report exactly.
The site is hash-routed, so the shell is only needed at the root.
Also skipWaiting so existing clients pick the fix up on next load.
Fixes gpujs/gpu.js#852
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 737cf74 commit 02d885d
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
0 commit comments