fix: chromium downloading hung at 99% (#8169)

set keep-alive header to fix downloading done without 'finish' event trigged on some devices.
This commit is contained in:
liangwu 2022-03-31 14:08:22 +08:00 committed by GitHub
parent 40f1fa7ab4
commit 8f13470af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -571,11 +571,15 @@ function httpRequest(
method?: string; method?: string;
agent?: HttpsProxyAgent; agent?: HttpsProxyAgent;
rejectUnauthorized?: boolean; rejectUnauthorized?: boolean;
headers?: http.OutgoingHttpHeaders | undefined;
}; };
let options: Options = { let options: Options = {
...urlParsed, ...urlParsed,
method, method,
headers: {
Connection: 'keep-alive',
},
}; };
const proxyURL = getProxyForUrl(url); const proxyURL = getProxyForUrl(url);