Skip to content

Commit 5b30755

Browse files
fix: allow hosting hash apps from other html files (#14825)
Fixes #14824. Simplify by just checking if we're still on the current pathname --------- Co-authored-by: Simon H <[email protected]>
1 parent 2ff3951 commit 5b30755

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

.changeset/upset-parents-sniff.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix: allow hosting hash-based apps from non-index.html files

packages/kit/src/runtime/client/utils.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,16 +317,7 @@ export function is_external_url(url, base, hash_routing) {
317317
}
318318

319319
if (hash_routing) {
320-
if (url.pathname === base + '/' || url.pathname === base + '/index.html') {
321-
return false;
322-
}
323-
324-
// be lenient if serving from filesystem
325-
if (url.protocol === 'file:' && url.pathname.replace(/\/[^/]+\.html?$/, '') === base) {
326-
return false;
327-
}
328-
329-
return true;
320+
return url.pathname !== location.pathname;
330321
}
331322

332323
return false;

0 commit comments

Comments
 (0)