File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ### Fixed
2+ - Disable axios default proxy in case of custom proxy agent used.
13
24## [ 5.5.1] - 2025-10-29
35### Fixed
Original file line number Diff line number Diff line change 1- 5.5.1
1+ 5.5.2-SNAPSHOT
Original file line number Diff line number Diff 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 {
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments