From 124f0718f9aa029b04ff453be3ee9731a7a29ea3 Mon Sep 17 00:00:00 2001 From: Daniel Bornstrand Date: Fri, 17 Mar 2017 15:49:59 +0100 Subject: [PATCH] Keep query params when using proxy When using a proxy, any query-parameters are lost. --- src/jspm-hmr-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jspm-hmr-server.ts b/src/jspm-hmr-server.ts index eac25f5..b4c1a8b 100644 --- a/src/jspm-hmr-server.ts +++ b/src/jspm-hmr-server.ts @@ -66,7 +66,7 @@ export function createServer(options: ServerOptions): JspmHmrServer { const proxy = httpProxy.createProxyServer(); app.use(proxyRoute, (req, res) => { - req.url = req.baseUrl; + req.url = `${req.baseUrl}${req.url}`; proxy.web(req, res, { target: proxyTarget }); proxy.on('error', (err: Error) => { console.log('Proxy Server Error: ', err.message);