From a2ce0518d64ca955e29150b0e5fa29a9418978ef Mon Sep 17 00:00:00 2001 From: Mingliang Chen Date: Tue, 25 Dec 2018 09:41:03 +0800 Subject: [PATCH] Update response.js Fixed UC browser does not stop reading --- lib/response.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index 398993a..01a7348 100644 --- a/lib/response.js +++ b/lib/response.js @@ -77,8 +77,10 @@ var IncomingMessage = exports.IncomingMessage = function (xhr, response, mode, f var reader = response.body.getReader() function read () { reader.read().then(function (result) { - if (self._destroyed) + if (self._destroyed) { + reader.cancel() return + } if (result.done) { global.clearTimeout(fetchTimer) self.push(null)