From 99e5ff6aae8667164b20e77cf358a2a6b209df21 Mon Sep 17 00:00:00 2001 From: Florian Dieminger Date: Fri, 20 Dec 2024 15:32:49 +0100 Subject: [PATCH] fix long download Running the postinstall script takes around 30s. It looks like https://github.com/nodejs/node/issues/47228 is the root cause. Adding a `response.resume()` is a working workaround. --- lib/download.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/download.js b/lib/download.js index 85bfd17..0defebe 100644 --- a/lib/download.js +++ b/lib/download.js @@ -63,6 +63,7 @@ function download(_url, dest, opts) { https.get(mergedOpts, response => { console.log('statusCode: ' + response.statusCode); if (response.statusCode === 302) { + response.resume(); console.log('Following redirect to: ' + response.headers.location); return download(response.headers.location, dest, opts) .then(resolve, reject);