diff --git a/lib/_http_client.js b/lib/_http_client.js index 135d31acaaec2d..460521c8ded85c 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -350,7 +350,7 @@ function socketCloseListener() { req.emit('close'); if (req.res && req.res.readable) { // Socket closed before we emitted 'end' below. - req.res.emit('aborted'); + if (!req.res.complete) req.res.emit('aborted'); var res = req.res; res.on('end', function() { res.emit('close');