Skip to content

Commit

Permalink
[fix breaking] Emit the proxyResponse event on the HttpProxy instan…
Browse files Browse the repository at this point in the history
…ce to reduce listener churn and reference counts.
  • Loading branch information
indexzero committed Mar 18, 2013
1 parent 701dc69 commit 2620f06
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/node-http-proxy/http-proxy.js
Expand Up @@ -318,7 +318,7 @@ HttpProxy.prototype.proxyRequest = function (req, res, buffer) {
});

// Allow observer to modify headers or abort response
try { req.emit('proxyResponse', req, res, response) }
try { self.emit('proxyResponse', req, res, response) }
catch (ex) {
errState = true;
return;
Expand Down
1 change: 1 addition & 0 deletions lib/node-http-proxy/routing-proxy.js
Expand Up @@ -116,6 +116,7 @@ RoutingProxy.prototype.add = function (options) {
'start',
'forward',
'end',
'proxyResponse',
'websocket:start',
'websocket:end',
'websocket:incoming',
Expand Down

0 comments on commit 2620f06

Please sign in to comment.