@reportportal/client-javascript 5.5.0 → 5.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/lib/oauth.js +4 -1
- package/lib/rest.js +5 -1
- package/package.json +1 -1
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
5.5.
|
|
1
|
+
5.5.3-SNAPSHOT
|
package/lib/oauth.js
CHANGED
|
@@ -154,8 +154,9 @@ class OAuthInterceptor {
|
|
|
154
154
|
const proxyAgents = hasCustomAgents
|
|
155
155
|
? {}
|
|
156
156
|
: getProxyAgentForUrl(this.tokenEndpoint, this.restClientConfig);
|
|
157
|
+
const usingProxyAgent = Object.keys(proxyAgents).length > 0;
|
|
157
158
|
|
|
158
|
-
if (this.debug &&
|
|
159
|
+
if (this.debug && usingProxyAgent) {
|
|
159
160
|
this.logDebug(`Making token request to ${this.tokenEndpoint} with proxy agent`);
|
|
160
161
|
}
|
|
161
162
|
|
|
@@ -167,6 +168,8 @@ class OAuthInterceptor {
|
|
|
167
168
|
// Custom agents from restClientConfig (if provided) take precedence
|
|
168
169
|
...(this.restClientConfig.httpsAgent && { httpsAgent: this.restClientConfig.httpsAgent }),
|
|
169
170
|
...(this.restClientConfig.httpAgent && { httpAgent: this.restClientConfig.httpAgent }),
|
|
171
|
+
// Explicitly disable axios built-in proxy when using custom agents
|
|
172
|
+
...(usingProxyAgent && { proxy: false }),
|
|
170
173
|
});
|
|
171
174
|
|
|
172
175
|
const {
|
package/lib/rest.js
CHANGED
|
@@ -67,8 +67,10 @@ class RestClient {
|
|
|
67
67
|
// Only apply proxy agents if custom agents are not explicitly provided
|
|
68
68
|
// Priority: explicit httpsAgent/httpAgent > proxy config > default
|
|
69
69
|
const hasCustomAgents =
|
|
70
|
-
|
|
70
|
+
this.restClientConfig &&
|
|
71
|
+
('httpsAgent' in this.restClientConfig || 'httpAgent' in this.restClientConfig);
|
|
71
72
|
const proxyAgents = hasCustomAgents ? {} : getProxyAgentForUrl(url, this.restClientConfig);
|
|
73
|
+
const usingProxyAgent = Object.keys(proxyAgents).length > 0;
|
|
72
74
|
|
|
73
75
|
return this.axiosInstance
|
|
74
76
|
.request({
|
|
@@ -77,6 +79,8 @@ class RestClient {
|
|
|
77
79
|
data,
|
|
78
80
|
...options,
|
|
79
81
|
...proxyAgents,
|
|
82
|
+
// Explicitly disable axios built-in proxy when using custom agents
|
|
83
|
+
...(usingProxyAgent && { proxy: false }),
|
|
80
84
|
headers: {
|
|
81
85
|
HOST: new URL(url).host,
|
|
82
86
|
...options.headers,
|