Skip to content

Commit

Permalink
Fix proxy path
Browse files Browse the repository at this point in the history
This fix considers the actual target path again (which has been ignored).
  • Loading branch information
Domiii authored and EndangeredMassa committed Sep 8, 2014
1 parent d16062b commit 511b7b3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http-proxy/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 511b7b3

Please sign in to comment.