We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02e8776 commit 27d7187Copy full SHA for 27d7187
1 file changed
src/main/client/AstClient.ts
@@ -19,8 +19,8 @@ export class AstClient {
19
20
try {
21
const proxyUrl = new URL(proxyEnv);
22
- const proxyPort = proxyUrl.port || (proxyUrl.protocol === 'http:' ? '80' : proxyUrl.protocol === 'https:' ? '443' : '');
23
- if (proxyPort === '') {
+ const proxyPort = Number(proxyUrl.port) || (proxyUrl.protocol === 'http:' ? 80 : proxyUrl.protocol === 'https:' ? 443 : 0);
+ if (proxyPort === 0) {
24
logger.error(`Invalid proxy URL: ${proxyUrl}. Port is missing. Proceeding without proxy agent.`);
25
return undefined;
26
}
@@ -32,7 +32,7 @@ export class AstClient {
32
const agent = tunnel.httpsOverHttp({
33
proxy: {
34
host: proxyUrl.hostname,
35
- port: Number(proxyPort),
+ port: proxyPort,
36
proxyAuth,
37
38
});
0 commit comments