Skip to content

Commit 10c2b95

Browse files
committed
Remove leading slash trim in base resolver
It's not necessary since we return early if the path starts with a slash.
1 parent 543d642 commit 10c2b95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/common/util.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export const resolveBase = (base?: string): string => {
4848
if (!base || base.startsWith("/")) {
4949
return base || ""
5050
}
51-
const parts = location.pathname.replace(/^\//g, "").split("/")
51+
const parts = location.pathname.split("/")
5252
parts[parts.length - 1] = base
5353
const url = new URL(location.origin + "/" + parts.join("/"))
5454
return normalize(url.pathname)

0 commit comments

Comments
 (0)