proxy rewrites: fixed a case where errors were thrown if the resolved 'to' address contained params (e.g. '*', ':param' etc)
This commit is contained in:
@ -88,6 +88,7 @@ function localWebServer (options) {
|
||||
if (options.rewrite && options.rewrite.length) {
|
||||
options.rewrite.forEach(route => {
|
||||
if (route.to) {
|
||||
/* `to` address is remote if the url specifies a host */
|
||||
if (url.parse(route.to).host) {
|
||||
debug('proxy rewrite', `${route.from} -> ${route.to}`)
|
||||
app.use(_.all(route.from, mw.proxyRequest(route, app)))
|
||||
|
Reference in New Issue
Block a user