mirror of
https://github.com/http-party/node-http-proxy.git
synced 2025-12-08 20:59:18 +00:00
[fix breaking] Emit the proxyResponse event on the HttpProxy instance to reduce listener churn and reference counts.
This commit is contained in:
parent
701dc698e3
commit
2620f06e2d
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user