diff --git a/request.js b/request.js index 198b76093..976a13209 100644 --- a/request.js +++ b/request.js @@ -989,7 +989,7 @@ Request.prototype.onRequestResponse = function (response) { // Be a good stream and emit end when the response is finished. // Hack to emit end on close because of a core bug that never fires end response.on('close', function () { - if (!self._ended) { + if (!self.req._ended) { self.response.emit('end') } })