From e202e962a4f3623a0c459d8a9b9d2429c2862957 Mon Sep 17 00:00:00 2001 From: Ben Kucera <14625260+Bkucera@users.noreply.github.com> Date: Fri, 15 Nov 2019 11:24:50 -0500 Subject: [PATCH] Fix infinite recursion during some redirects Cherry-pick 8afbb25637819de73bc523fa59a66a5055f2a36d Co-authored-by: Zach Bloomquist --- request.js | 1 + 1 file changed, 1 insertion(+) diff --git a/request.js b/request.js index a1203707c..2d53e4b04 100644 --- a/request.js +++ b/request.js @@ -1374,6 +1374,7 @@ Request.prototype.onRequestResponse = function (response) { // Hack to emit end on close because of a core bug that never fires end response.once('close', function () { if (!self._ended) { + self._ended = true self.response.emit('end') } })