fixed issue with rewrite 'from' urls containing ports
This commit is contained in:
@ -14,7 +14,7 @@ const pathToRegexp = require('path-to-regexp')
|
||||
module.exports = localWebServer
|
||||
|
||||
/**
|
||||
* Returns a Koa application you can launch or mix into an existing app.
|
||||
* Returns a Koa application you can launch or mix into an existing app.
|
||||
*
|
||||
* @param [options] {object} - options
|
||||
* @param [options.static] {object} - koa-static config
|
||||
@ -190,7 +190,7 @@ function proxyRequest (route, app) {
|
||||
|
||||
/* test no keys remain in the new path */
|
||||
keys.length = 0
|
||||
pathToRegexp(route.new, keys)
|
||||
pathToRegexp(url.parse(route.new).path, keys)
|
||||
if (keys.length) {
|
||||
this.throw(500, `[PROXY] Invalid target URL: ${route.new}`)
|
||||
return next()
|
||||
|
Reference in New Issue
Block a user