Fixes Issue #3233: set httpsAgentRequestFields on request.httpsAgent when shouldProxy or shouldUseSystemProxy was false (#3317)

* fix: set httpsAgentRequestFields on request.httpsAgent when shouldProxy is false
* fix: set httpsAgentRequestFields on request.httpsAgent when shouldUseSystemProxy is false
This commit is contained in:
Giuseppe 2024-10-23 17:30:27 +02:00 committed by GitHub
parent 432d54acca
commit 6588dcf2fd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -233,6 +233,10 @@ const configureRequest = async (
);
request.httpAgent = new HttpProxyAgent(proxyUri);
}
} else {
request.httpsAgent = new https.Agent({
...httpsAgentRequestFields
});
}
} else if (proxyMode === 'system') {
const { http_proxy, https_proxy, no_proxy } = preferencesUtil.getSystemProxyEnvVariables();
@ -257,6 +261,10 @@ const configureRequest = async (
} catch (error) {
throw new Error('Invalid system https_proxy');
}
} else {
request.httpsAgent = new https.Agent({
...httpsAgentRequestFields
});
}
} else if (Object.keys(httpsAgentRequestFields).length > 0) {
request.httpsAgent = new https.Agent({