Skip to content

Commit db820ee

Browse files
authored
EPMRPP-109375 || Fix the default agent params overriding via 'restClientConfig.agent' option (#241)
1 parent 440a4e3 commit db820ee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/rest.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ class RestClient {
6565

6666
request(method, url, data, options = {}) {
6767
// Only apply proxy agents if custom agents are not explicitly provided
68-
// Priority: explicit httpsAgent/httpAgent > proxy config > default
68+
// Priority: explicit httpsAgent/httpAgent/agent > proxy config > default
6969
const hasCustomAgents =
7070
this.restClientConfig &&
71-
('httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig);
71+
('httpsAgent' in this.restClientConfig ||
72+
'httpAgent' in this.restClientConfig ||
73+
'agent' in this.restClientConfig);
7274
const proxyAgents = hasCustomAgents ? {} : getProxyAgentForUrl(url, this.restClientConfig);
7375
const usingProxyAgent = Object.keys(proxyAgents).length > 0;
7476

0 commit comments

Comments
 (0)