Permalink
Browse files

[fix breaking] Emit the `proxyResponse` event on the HttpProxy instan…

…ce to reduce listener churn and reference counts.
  • Loading branch information...
1 parent 701dc69 commit 2620f06e2db9a267945566f10837c4c2a5df753d @indexzero indexzero committed Mar 18, 2013
Showing with 2 additions and 1 deletion.
  1. +1 −1 lib/node-http-proxy/http-proxy.js
  2. +1 −0 lib/node-http-proxy/routing-proxy.js
@@ -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;
@@ -116,6 +116,7 @@ RoutingProxy.prototype.add = function (options) {
'start',
'forward',
'end',
+ 'proxyResponse',
'websocket:start',
'websocket:end',
'websocket:incoming',

0 comments on commit 2620f06

Please sign in to comment.