mirror of
https://git.tuxpa.in/a/code-server.git
synced 2024-12-27 04:35:25 +00:00
Use route.fullPath when adding trailing slash
There's no need to specially construct the path.
This commit is contained in:
parent
411c61fb02
commit
498becd11f
@ -49,14 +49,14 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
|
||||
}
|
||||
|
||||
// Ensure there is a trailing slash so relative paths work correctly.
|
||||
const port = route.base.replace(/^\//, "")
|
||||
const base = `${this.options.base}/${port}`
|
||||
if (this.isRoot(route) && !route.fullPath.endsWith("/")) {
|
||||
return {
|
||||
redirect: `${base}/`,
|
||||
redirect: `${route.fullPath}/`,
|
||||
}
|
||||
}
|
||||
|
||||
const port = route.base.replace(/^\//, "")
|
||||
const base = `${this.options.base}/${port}`
|
||||
const payload = this.doProxy(route, request, response, port, base)
|
||||
if (payload) {
|
||||
return payload
|
||||
|
Loading…
Reference in New Issue
Block a user