From 498becd11fbaaed4802214ba2374103448e982dd Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 2 Apr 2020 11:32:19 -0500 Subject: [PATCH] Use route.fullPath when adding trailing slash There's no need to specially construct the path. --- src/node/app/proxy.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/node/app/proxy.ts b/src/node/app/proxy.ts index 42e73a60..19812cc1 100644 --- a/src/node/app/proxy.ts +++ b/src/node/app/proxy.ts @@ -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