Skip to content

Commit

Permalink
Merge pull request #398 from joeyparrish/fix-node-v12
Browse files Browse the repository at this point in the history
fix: Fix test failures in node v4-v12
  • Loading branch information
tomas authored Apr 7, 2022
2 parents 33e834f + 64dfba1 commit b5cf883
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/needle.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,12 +542,11 @@ Needle.prototype.send_request = function(count, method, uri, config, post_data,
out.done = true;

// An error can still be fired after closing. In particular, on macOS.
// Adding an explicit abort() call resolves this without leaving a dangling
// listener. See also:
// See also:
// - https://github.com/tomas/needle/issues/391
// - https://github.com/less/less.js/issues/3693
// - https://github.com/nodejs/node/issues/27916
request.abort();
request.once('error', function() {});

if (callback)
return callback(err, resp, resp ? resp.body : undefined);
Expand Down

0 comments on commit b5cf883

Please sign in to comment.