Skip to content

Commit 2c6b732

Browse files
Merge pull request #237 from AlexGalichenko/fix-custom-agent
fixed issue in request method in case if this.restClientConfig is not provided in config
1 parent b86e7f9 commit 2c6b732

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/rest.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ class RestClient {
6767
// Only apply proxy agents if custom agents are not explicitly provided
6868
// Priority: explicit httpsAgent/httpAgent > proxy config > default
6969
const hasCustomAgents =
70-
'httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig;
70+
this.restClientConfig &&
71+
('httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig);
7172
const proxyAgents = hasCustomAgents ? {} : getProxyAgentForUrl(url, this.restClientConfig);
7273

7374
return this.axiosInstance

0 commit comments

Comments
 (0)