Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5277ca6

Browse files
committedApr 2, 2020
Use route.fullPath when adding trailing slash
There's no need to specially construct the path.
1 parent 37c4efd commit 5277ca6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎src/node/app/proxy.ts

+3-3
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)
Please sign in to comment.