Skip to content

Commit

Permalink
[fix] use the correct arguments order
Browse files Browse the repository at this point in the history
  • Loading branch information
cronopio committed Oct 22, 2013
1 parent 7c72f3b commit cc09ae6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/http-proxy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function createRightProxy(type) {
* refer to the connection socket
* pass(req, socket, options, head)
*/
if(passes[i](req, res, cbl ? false : this, head, cbl)) { // passes can return a truthy value to halt the loop
if(passes[i](req, res, this.options, head, cbl ? false : this, cbl)) { // passes can return a truthy value to halt the loop
break;
}
}
Expand Down
12 changes: 6 additions & 6 deletions lib/http-proxy/passes/web-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,19 +89,19 @@ web_o = Object.keys(web_o).map(function(pass) {
* @api private
*/

function stream(req, res, server, _, clb) {
if(server.options.forward) {
function stream(req, res, options, head, server, clb) {
if(options.forward) {
// If forward enable, so just pipe the request
var forwardReq = (server.options.forward.protocol === 'https:' ? https : http).request(
common.setupOutgoing(server.options.ssl || {}, server.options, req, 'forward')
var forwardReq = (options.forward.protocol === 'https:' ? https : http).request(
common.setupOutgoing(options.ssl || {}, options, req, 'forward')
);
req.pipe(forwardReq);
return res.end();
}

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

// Error Handler
Expand Down

0 comments on commit cc09ae6

Please sign in to comment.