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:
@ -33,14 +33,6 @@ function proxyRequest (route, app) {
|
||||
.replace(re, arguments[index + 1] || '')
|
||||
})
|
||||
|
||||
/* test no keys remain in the new path */
|
||||
keys.length = 0
|
||||
pathToRegexp(url.parse(route.new).path, keys)
|
||||
if (keys.length) {
|
||||
this.throw(500, `[PROXY] Invalid target URL: ${route.new}`)
|
||||
return next()
|
||||
}
|
||||
|
||||
this.response = false
|
||||
debug('proxy request', `from: ${this.path}, to: ${url.parse(route.new).href}`)
|
||||
|
||||
|
Reference in New Issue
Block a user