Fix proxy path

This fix considers the actual target path again (which has been ignored).
This commit is contained in:
Domi 2014-05-31 17:35:30 +08:00 committed by Sean Massa
parent d16062bba2
commit 511b7b3d47

View File

@ -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;