diff --git a/lib/rest.js b/lib/rest.js index cf4ca73..b5f752f 100644 --- a/lib/rest.js +++ b/lib/rest.js @@ -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;