Skip to content

Commit cc09ae6

Browse files
committed
[fix] use the correct arguments order
1 parent 7c72f3b commit cc09ae6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lib/http-proxy/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function createRightProxy(type) {
7373
* refer to the connection socket
7474
* pass(req, socket, options, head)
7575
*/
76-
if(passes[i](req, res, cbl ? false : this, head, cbl)) { // passes can return a truthy value to halt the loop
76+
if(passes[i](req, res, this.options, head, cbl ? false : this, cbl)) { // passes can return a truthy value to halt the loop
7777
break;
7878
}
7979
}

lib/http-proxy/passes/web-incoming.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ web_o = Object.keys(web_o).map(function(pass) {
8989
* @api private
9090
*/
9191

92-
function stream(req, res, server, _, clb) {
93-
if(server.options.forward) {
92+
function stream(req, res, options, head, server, clb) {
93+
if(options.forward) {
9494
// If forward enable, so just pipe the request
95-
var forwardReq = (server.options.forward.protocol === 'https:' ? https : http).request(
96-
common.setupOutgoing(server.options.ssl || {}, server.options, req, 'forward')
95+
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
96+
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
9797
);
9898
req.pipe(forwardReq);
9999
return res.end();
100100
}
101101

102102
// Request initalization
103-
var proxyReq = (server.options.target.protocol === 'https:' ? https : http).request(
104-
common.setupOutgoing(server.options.ssl || {}, server.options, req)
103+
var proxyReq = (options.target.protocol === 'https:' ? https : http).request(
104+
common.setupOutgoing(options.ssl || {}, options, req)
105105
);
106106

107107
// Error Handler

0 commit comments

Comments
 (0)