From 6f64d9e72b13f4ca512f67c5a90bf485941be77b Mon Sep 17 00:00:00 2001 From: Ilya_Hancharyk Date: Thu, 13 Nov 2025 12:31:14 +0100 Subject: [PATCH] EPMRPP-109375 || Fix the default agent params overriding via 'restClientConfig.agent' option --- lib/rest.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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;