diff --git a/lib/http-proxy/common.js b/lib/http-proxy/common.js index 5d10647..9de052e 100644 --- a/lib/http-proxy/common.js +++ b/lib/http-proxy/common.js @@ -57,10 +57,14 @@ common.setupOutgoing = function(outgoing, options, req, forward) { ) { outgoing.headers.connection = 'close'; } } + + // the final path is target path + relative path requested by user: + outgoing.path = options.target.path; + // // Remark: Can we somehow not use url.parse as a perf optimization? // - outgoing.path = !options.toProxy + outgoing.path += !options.toProxy ? url.parse(req.url).path : req.url;