Skip to content

Commit c19c0fe

Browse files
authored
Merge pull request #239 from reportportal/develop
Release 5.5.2
2 parents c8f91bd + 40cae91 commit c19c0fe

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
### Fixed
2+
- Disable axios default proxy in case of custom proxy agent used.
13

24
## [5.5.1] - 2025-10-29
35
### Fixed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.5.1
1+
5.5.2-SNAPSHOT

lib/oauth.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,9 @@ class OAuthInterceptor {
154154
const proxyAgents = hasCustomAgents
155155
? {}
156156
: getProxyAgentForUrl(this.tokenEndpoint, this.restClientConfig);
157+
const usingProxyAgent = Object.keys(proxyAgents).length > 0;
157158

158-
if (this.debug && Object.keys(proxyAgents).length > 0) {
159+
if (this.debug && usingProxyAgent) {
159160
this.logDebug(`Making token request to ${this.tokenEndpoint} with proxy agent`);
160161
}
161162

@@ -167,6 +168,8 @@ class OAuthInterceptor {
167168
// Custom agents from restClientConfig (if provided) take precedence
168169
...(this.restClientConfig.httpsAgent && { httpsAgent: this.restClientConfig.httpsAgent }),
169170
...(this.restClientConfig.httpAgent && { httpAgent: this.restClientConfig.httpAgent }),
171+
// Explicitly disable axios built-in proxy when using custom agents
172+
...(usingProxyAgent && { proxy: false }),
170173
});
171174

172175
const {

lib/rest.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class RestClient {
7070
this.restClientConfig &&
7171
('httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig);
7272
const proxyAgents = hasCustomAgents ? {} : getProxyAgentForUrl(url, this.restClientConfig);
73+
const usingProxyAgent = Object.keys(proxyAgents).length > 0;
7374

7475
return this.axiosInstance
7576
.request({
@@ -78,6 +79,8 @@ class RestClient {
7879
data,
7980
...options,
8081
...proxyAgents,
82+
// Explicitly disable axios built-in proxy when using custom agents
83+
...(usingProxyAgent && { proxy: false }),
8184
headers: {
8285
HOST: new URL(url).host,
8386
...options.headers,

0 commit comments

Comments
 (0)