Skip to content

Commit 498becd

Browse files
committed
Use route.fullPath when adding trailing slash
There's no need to specially construct the path.
1 parent 411c61f commit 498becd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/node/app/proxy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ export class ProxyHttpProvider extends HttpProvider implements HttpProxyProvider
4949
}
5050

5151
// Ensure there is a trailing slash so relative paths work correctly.
52-
const port = route.base.replace(/^\//, "")
53-
const base = `${this.options.base}/${port}`
5452
if (this.isRoot(route) && !route.fullPath.endsWith("/")) {
5553
return {
56-
redirect: `${base}/`,
54+
redirect: `${route.fullPath}/`,
5755
}
5856
}
5957

58+
const port = route.base.replace(/^\//, "")
59+
const base = `${this.options.base}/${port}`
6060
const payload = this.doProxy(route, request, response, port, base)
6161
if (payload) {
6262
return payload

0 commit comments

Comments
 (0)