Skip to content

Commit 84eb32e

Browse files
committed
chore: improve localhost check
1 parent 9ffbb29 commit 84eb32e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/loader-async.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,10 @@ function isHttpSpecifier(specifier: string) {
6363
}
6464

6565
function isLocalhost(specifier: string) {
66-
return specifier.startsWith('http://localhost') || specifier.startsWith('http://127.0.0.1');
66+
return specifier.startsWith('http://localhost:') ||
67+
specifier.startsWith('http://localhost/') ||
68+
specifier.startsWith('http://127.0.0.1:') ||
69+
specifier.startsWith('http://127.0.0.1/');
6770
}
6871

6972
function isRelativeImport(specifier: string) {

0 commit comments

Comments
 (0)