Merge branch 'master' into next

This commit is contained in:
Lloyd Brookes
2015-11-19 13:54:36 +00:00
3 changed files with 29 additions and 4 deletions

View File

@ -11,7 +11,7 @@ let debug
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
@ -205,7 +205,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()