未验证 提交 498becd1 编写于 作者: A Asher

Use route.fullPath when adding trailing slash

There's no need to specially construct the path.
上级 411c61fb
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册