Skip to content

Commit

Permalink
Merge pull request #1774 from afharo/remove-v14-destroy-before-abort-…
Browse files Browse the repository at this point in the history
…hack

fix: do not force-set `req.destroyed = true` on abort
  • Loading branch information
titanism committed Aug 15, 2023
2 parents 73c7efb + 70c464c commit 4691583
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/request-base.js
Original file line number Diff line number Diff line change
Expand Up @@ -501,10 +501,6 @@ RequestBase.prototype.abort = function () {
throw new Error(
'Superagent does not work in v13 properly with abort() due to Node.js core changes'
);
} else if (semver.gte(process.version, 'v14.0.0')) {
// We have to manually set `destroyed` to `true` in order for this to work
// (see core internals of end-of-stream.js above in v14 branch as compared to v12)
this.req.destroyed = true;
}

this.req.abort(); // node
Expand Down

0 comments on commit 4691583

Please sign in to comment.