Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,12 @@ class RestClient {

request(method, url, data, options = {}) {
// Only apply proxy agents if custom agents are not explicitly provided
// Priority: explicit httpsAgent/httpAgent > proxy config > default
// Priority: explicit httpsAgent/httpAgent/agent > proxy config > default
const hasCustomAgents =
this.restClientConfig &&
('httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig);
('httpsAgent' in this.restClientConfig ||
'httpAgent' in this.restClientConfig ||
'agent' in this.restClientConfig);
const proxyAgents = hasCustomAgents ? {} : getProxyAgentForUrl(url, this.restClientConfig);
const usingProxyAgent = Object.keys(proxyAgents).length > 0;

Expand Down
Loading