Skip to content

Commit

Permalink
fix: do not force-set req.destroyed = true on abort
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo committed Aug 14, 2023
1 parent 73c7efb commit 70c464c
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/request-base.js
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 70c464c

Please sign in to comment.