mirror of https://git.tuxpa.in/a/code-server.git
Remove leading slash trim in base resolver
It's not necessary since we return early if the path starts with a slash.
This commit is contained in:
parent
543d64268d
commit
10c2b956ac
|
@ -48,7 +48,7 @@ export const resolveBase = (base?: string): string => {
|
||||||
if (!base || base.startsWith("/")) {
|
if (!base || base.startsWith("/")) {
|
||||||
return base || ""
|
return base || ""
|
||||||
}
|
}
|
||||||
const parts = location.pathname.replace(/^\//g, "").split("/")
|
const parts = location.pathname.split("/")
|
||||||
parts[parts.length - 1] = base
|
parts[parts.length - 1] = base
|
||||||
const url = new URL(location.origin + "/" + parts.join("/"))
|
const url = new URL(location.origin + "/" + parts.join("/"))
|
||||||
return normalize(url.pathname)
|
return normalize(url.pathname)
|
||||||
|
|
Loading…
Reference in New Issue