mirror of https://github.com/coder/code-server.git
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.
|
// 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("/")) {
|
if (this.isRoot(route) && !route.fullPath.endsWith("/")) {
|
||||||
return {
|
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)
|
const payload = this.doProxy(route, request, response, port, base)
|
||||||
if (payload) {
|
if (payload) {
|
||||||
return payload
|
return payload
|
||||||
|
|
Loading…
Reference in New Issue