Skip to content

Commit 2174b32

Browse files
committed
fix: Fix test failures in node v4-v12
These failures were introduced by PR tomas#392 Closes tomas#397
1 parent 67ad8a4 commit 2174b32

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/needle.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,11 @@ Needle.prototype.send_request = function(count, method, uri, config, post_data,
490490
out.done = true;
491491

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

500499
if (callback)
501500
return callback(err, resp, resp ? resp.body : undefined);

0 commit comments

Comments
 (0)