Skip to content

Commit

Permalink
Rename hasAborted -> supportsAbortedEvent to match current PR in dead…
Browse files Browse the repository at this point in the history
… repo
  • Loading branch information
Jimbly committed Dec 28, 2023
1 parent 6a25abb commit 2881b81
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/http-proxy/passes/web-incoming.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var nativeAgents = { http: httpNative, https: httpsNative };
*/

// 'aborted' event stopped working reliably on v15.5.0 and was later removed entirely
var hasAborted = (function () {
var supportsAbortedEvent = (function () {
var ver = process.versions.node.split('.').map(Number);
return ver[0] <= 14 || ver[0] === 15 && ver[1] <= 4;
}());
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = {
}

// Ensure we abort proxy if request is aborted
if (hasAborted) {
if (supportsAbortedEvent) {
req.on('aborted', function () {
proxyReq.abort();
});
Expand Down

0 comments on commit 2881b81

Please sign in to comment.