Skip to content

Commit 799659d

Browse files
committed
chore: tweak a bit
1 parent d63cb86 commit 799659d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/client/app/router.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ export function createRouter(
182182
link.baseURI
183183
)
184184
const currentUrl = window.location
185+
const mimeType = lookup(pathname)
185186
// only intercept inbound links
186187
if (
187188
!e.ctrlKey &&
@@ -190,8 +191,8 @@ export function createRouter(
190191
!e.metaKey &&
191192
!target &&
192193
origin === currentUrl.origin &&
193-
// don't intercept if non-html extension is present
194-
(lookup(pathname) == null || lookup(pathname) === 'text/html')
194+
// intercept only html and unknown types (assume html)
195+
(!mimeType || mimeType === 'text/html')
195196
) {
196197
e.preventDefault()
197198
if (

0 commit comments

Comments
 (0)