From 095b1a694bf1aea0c098091a46b3ca576d3d51a9 Mon Sep 17 00:00:00 2001 From: Qiao Han Date: Sun, 31 Dec 2023 06:41:20 +0800 Subject: [PATCH] fix: disable http agent keep alive for postinstall --- scripts/postinstall.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/postinstall.js b/scripts/postinstall.js index 8c010f71b..80c092ab7 100755 --- a/scripts/postinstall.js +++ b/scripts/postinstall.js @@ -133,8 +133,8 @@ async function main() { // Keeps the TCP connection alive when sending multiple requests // Ref: https://github.com/node-fetch/node-fetch/issues/1735 const agent = proxyUrl - ? new HttpsProxyAgent(proxyUrl, { keepAlive: true }) - : new Agent({ keepAlive: true }); + ? new HttpsProxyAgent(proxyUrl, { keepAlive: false }) + : new Agent({ keepAlive: false }); const resp = await fetch(url, { agent }); const hash = createHash("sha256");