Skip to content

Commit

Permalink
Use "close" event on res rather than attaching an event handler to th…
Browse files Browse the repository at this point in the history
…e socket
  • Loading branch information
tephenavies committed May 14, 2024
1 parent 248e00f commit 5c3d523
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/controllers/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ module.exports = function(options) {
// encoding : null means "body" passed to the callback will be raw bytes

var proxiedRequest;
req.socket.once('close', function() {
res.once('close', function() {
if (proxiedRequest && !res.writableEnded) {
proxiedRequest.abort();
}
Expand Down

0 comments on commit 5c3d523

Please sign in to comment.