From 3f1750cf83ac23ef390e997cb039eb3ec30d2f58 Mon Sep 17 00:00:00 2001 From: Asher Date: Thu, 5 Nov 2020 14:34:57 -0600 Subject: [PATCH] Fix destroying response in update again I added another reject that doesn't destroy the response. --- src/node/update.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node/update.ts b/src/node/update.ts index 2959b874..13ac73c3 100644 --- a/src/node/update.ts +++ b/src/node/update.ts @@ -111,14 +111,13 @@ export class UpdateProvider { if (response.statusCode >= 300) { ++redirects + response.destroy() if (redirects > maxRedirects) { - response.destroy() return reject(new Error("reached max redirects")) } if (!response.headers.location) { return reject(new Error("received redirect with no location header")) } - response.destroy() return request(url.resolve(uri, response.headers.location)) }