Skip to content

Commit 511b7b3

Browse files
DomiiiEndangeredMassa
authored andcommitted
Fix proxy path
This fix considers the actual target path again (which has been ignored).
1 parent d16062b commit 511b7b3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/http-proxy/common.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,14 @@ common.setupOutgoing = function(outgoing, options, req, forward) {
5757
) { outgoing.headers.connection = 'close'; }
5858
}
5959

60+
61+
// the final path is target path + relative path requested by user:
62+
outgoing.path = options.target.path;
63+
6064
//
6165
// Remark: Can we somehow not use url.parse as a perf optimization?
6266
//
63-
outgoing.path = !options.toProxy
67+
outgoing.path += !options.toProxy
6468
? url.parse(req.url).path
6569
: req.url;
6670

0 commit comments

Comments
 (0)