Skip to content

Commit d5121b4

Browse files
jcassidyavrigor789
andauthored
fix(http-client): requests with no proxy configured (#5573)
* fix: running tests / http requests where no proxy configured * fix: allow axios defaults for agent Co-authored-by: Igor Randjelovic <[email protected]> * cleanup: remove unneeded import Co-authored-by: Igor Randjelovic <[email protected]>
1 parent e584ff1 commit d5121b4

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/common/http-client.ts

+9-6
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@ export class HttpClient implements Server.IHttpClient {
9898

9999
this.$logger.trace("httpRequest: %s", util.inspect(options));
100100

101-
const agent = tunnel.httpsOverHttp({
102-
proxy: {
103-
host: cliProxySettings.hostname,
104-
port: parseInt(cliProxySettings.port),
105-
},
106-
});
101+
let agent;
102+
if (cliProxySettings) {
103+
agent = tunnel.httpsOverHttp({
104+
proxy: {
105+
host: cliProxySettings.hostname,
106+
port: parseInt(cliProxySettings.port),
107+
},
108+
});
109+
}
107110
const result = await axios({
108111
url: options.url,
109112
headers: options.headers,

lib/services/test-execution-service.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export class TestExecutionService implements ITestExecutionService {
8181
liveSyncInfo.projectDir,
8282
TestExecutionService.SOCKETIO_JS_FILE_NAME
8383
),
84-
socketIoJs
84+
JSON.parse(socketIoJs)
8585
);
8686
}
8787

0 commit comments

Comments
 (0)