fix(cef): correct systemviews asset paths
- commit
- 940a0b9c9458f8d8e478cd42b41582d5fa753c63
- author
- brice · · 2026-04-11 18:43 UTC
- committer
- brice · · 2026-04-12 04:52 UTC
- parent
- 4a71c89
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +9 -9
M internal/infrastructure/cef/scheme_handler.go +4 -5
| @@ -33,16 +33,15 @@ const ( | |||
| 33 | 33 | webrtcPath = "webrtc" | |
| 34 | 34 | errorPath = "error" | |
| 35 | 35 | indexHTML = "index.html" | |
| 36 | - | systemviewsIndexHTML = "systemviews/index.html" | |
| 37 | 36 | maxSchemeTruncatedURLLength = 240 | |
| 38 | 37 | ) | |
| 39 | 38 | ||
| 40 | 39 | // pageRootFiles maps internal page hosts/paths to their HTML entry points. | |
| 41 | 40 | var pageRootFiles = map[string]string{ | |
| 42 | 41 | homePath: indexHTML, | |
| 43 | - | historyPath: systemviewsIndexHTML, | |
| 44 | - | favoritesPath: systemviewsIndexHTML, | |
| 45 | - | configPath: systemviewsIndexHTML, | |
| 42 | + | historyPath: indexHTML, | |
| 43 | + | favoritesPath: indexHTML, | |
| 44 | + | configPath: indexHTML, | |
| 46 | 45 | webrtcPath: "webrtc.html", | |
| 47 | 46 | errorPath: "error.html", | |
| 48 | 47 | } | |
| @@ -382,7 +381,7 @@ func resolveActualAssetPath(u *url.URL) (assetDir, relPath string, ok bool) { | |||
| 382 | 381 | if page == homePath && parts[1] == "crash" { | |
| 383 | 382 | return "", "", false | |
| 384 | 383 | } | |
| 385 | - | return assetDirForPageHost(page), path, true | |
| 384 | + | return assetDirForPageHost(page), parts[1], true | |
| 386 | 385 | } | |
| 387 | 386 | ||
| 388 | 387 | if strings.HasPrefix(path, "api/") { | |
| @@ -33,16 +33,15 @@ const ( | |||||
| 33 | webrtcPath = "webrtc" | 33 | webrtcPath = "webrtc" | ||
| 34 | errorPath = "error" | 34 | errorPath = "error" | ||
| 35 | indexHTML = "index.html" | 35 | indexHTML = "index.html" | ||
| 36 | - | systemviewsIndexHTML = "systemviews/index.html" | |||
| 37 | maxSchemeTruncatedURLLength = 240 | 36 | maxSchemeTruncatedURLLength = 240 | ||
| 38 | ) | 37 | ) | ||
| 39 | 38 | ||||
| 40 | // pageRootFiles maps internal page hosts/paths to their HTML entry points. | 39 | // pageRootFiles maps internal page hosts/paths to their HTML entry points. | ||
| 41 | var pageRootFiles = map[string]string{ | 40 | var pageRootFiles = map[string]string{ | ||
| 42 | homePath: indexHTML, | 41 | homePath: indexHTML, | ||
| 43 | - | historyPath: systemviewsIndexHTML, | 42 | + | historyPath: indexHTML, |
| 44 | - | favoritesPath: systemviewsIndexHTML, | 43 | + | favoritesPath: indexHTML, |
| 45 | - | configPath: systemviewsIndexHTML, | 44 | + | configPath: indexHTML, |
| 46 | webrtcPath: "webrtc.html", | 45 | webrtcPath: "webrtc.html", | ||
| 47 | errorPath: "error.html", | 46 | errorPath: "error.html", | ||
| 48 | } | 47 | } | ||
| @@ -382,7 +381,7 @@ func resolveActualAssetPath(u *url.URL) (assetDir, relPath string, ok bool) { | |||||
| 382 | if page == homePath && parts[1] == "crash" { | 381 | if page == homePath && parts[1] == "crash" { | ||
| 383 | return "", "", false | 382 | return "", "", false | ||
| 384 | } | 383 | } | ||
| 385 | - | return assetDirForPageHost(page), path, true | 384 | + | return assetDirForPageHost(page), parts[1], true |
| 386 | } | 385 | } | ||
| 387 | 386 | ||||
| 388 | if strings.HasPrefix(path, "api/") { | 387 | if strings.HasPrefix(path, "api/") { | ||
M internal/infrastructure/cef/scheme_handler_systemviews_test.go +5 -4
| @@ -14,10 +14,11 @@ func TestResolveAssetPath_SystemviewsRootsUseSystemviewsShell(t *testing.T) { | |||
| 14 | 14 | wantDir string | |
| 15 | 15 | wantRel string | |
| 16 | 16 | }{ | |
| 17 | - | {name: "history host", raw: "https://dumber.invalid/history", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | |
| 18 | - | {name: "favorites host", raw: "https://dumber.invalid/favorites", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | |
| 19 | - | {name: "config host", raw: "https://dumber.invalid/config", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | |
| 20 | - | {name: "history opaque", raw: "dumb:history", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | |
| 17 | + | {name: "history host", raw: "https://dumber.invalid/history", wantDir: "systemviews", wantRel: indexHTML}, | |
| 18 | + | {name: "favorites host", raw: "https://dumber.invalid/favorites", wantDir: "systemviews", wantRel: indexHTML}, | |
| 19 | + | {name: "config host", raw: "https://dumber.invalid/config", wantDir: "systemviews", wantRel: indexHTML}, | |
| 20 | + | {name: "history opaque", raw: "dumb:history", wantDir: "systemviews", wantRel: indexHTML}, | |
| 21 | + | {name: "history sub-asset", raw: "https://dumber.invalid/history/wasm_exec.js", wantDir: "systemviews", wantRel: "wasm_exec.js"}, | |
| 21 | 22 | } | |
| 22 | 23 | ||
| 23 | 24 | for _, tt := range tests { | |
| @@ -14,10 +14,11 @@ func TestResolveAssetPath_SystemviewsRootsUseSystemviewsShell(t *testing.T) { | |||||
| 14 | wantDir string | 14 | wantDir string | ||
| 15 | wantRel string | 15 | wantRel string | ||
| 16 | }{ | 16 | }{ | ||
| 17 | - | {name: "history host", raw: "https://dumber.invalid/history", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | 17 | + | {name: "history host", raw: "https://dumber.invalid/history", wantDir: "systemviews", wantRel: indexHTML}, |
| 18 | - | {name: "favorites host", raw: "https://dumber.invalid/favorites", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | 18 | + | {name: "favorites host", raw: "https://dumber.invalid/favorites", wantDir: "systemviews", wantRel: indexHTML}, |
| 19 | - | {name: "config host", raw: "https://dumber.invalid/config", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | 19 | + | {name: "config host", raw: "https://dumber.invalid/config", wantDir: "systemviews", wantRel: indexHTML}, |
| 20 | - | {name: "history opaque", raw: "dumb:history", wantDir: "systemviews", wantRel: systemviewsIndexHTML}, | 20 | + | {name: "history opaque", raw: "dumb:history", wantDir: "systemviews", wantRel: indexHTML}, |
| 21 | + | {name: "history sub-asset", raw: "https://dumber.invalid/history/wasm_exec.js", wantDir: "systemviews", wantRel: "wasm_exec.js"}, | |||
| 21 | } | 22 | } | ||
| 22 | 23 | ||||
| 23 | for _, tt := range tests { | 24 | for _, tt := range tests { | ||