mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
Fix proxy path
This fix considers the actual target path again (which has been ignored).
This commit is contained in:
parent
d16062bba2
commit
511b7b3d47
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user