Skip to content

Commit 1e74e24

Browse files
committed
feat: allow hosting hash-based apps from html files other than index.html
Fixes #14824.
1 parent 102aecf commit 1e74e24

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,11 @@ 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) {
320+
if (
321+
url.pathname === base + '/' ||
322+
url.pathname === base + '/index.html' ||
323+
url.pathname.replace(/\/[^/]+\.html?$/, '') === base
324+
) {
326325
return false;
327326
}
328327

0 commit comments

Comments
 (0)