proxy path fix
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
const http = require('http')
|
||||
const url = require('url')
|
||||
const Koa = require('koa')
|
||||
const serve = require('koa-static')
|
||||
const convert = require('koa-convert')
|
||||
@ -14,7 +16,6 @@ const _ = require('koa-route')
|
||||
const mount = require('koa-mount')
|
||||
const httpProxy = require('http-proxy')
|
||||
const pathToRegexp = require('path-to-regexp')
|
||||
const http = require('http')
|
||||
|
||||
/**
|
||||
* @module local-web-server
|
||||
@ -61,7 +62,7 @@ function getApp (options) {
|
||||
.replace(re.index, arguments[index] || '')
|
||||
})
|
||||
proxy.once('proxyReq', function (proxyReq) {
|
||||
proxyReq.path = route.new;
|
||||
proxyReq.path = url.parse(route.new).path;
|
||||
})
|
||||
proxy.web(this.req, this.res, { target: route.new })
|
||||
}))
|
||||
|
Reference in New Issue
Block a user