Skip to content

Commit 27d7187

Browse files
committed
make proxy port as number
1 parent 02e8776 commit 27d7187

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/client/AstClient.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ export class AstClient {
1919

2020
try {
2121
const proxyUrl = new URL(proxyEnv);
22-
const proxyPort = proxyUrl.port || (proxyUrl.protocol === 'http:' ? '80' : proxyUrl.protocol === 'https:' ? '443' : '');
23-
if (proxyPort === '') {
22+
const proxyPort = Number(proxyUrl.port) || (proxyUrl.protocol === 'http:' ? 80 : proxyUrl.protocol === 'https:' ? 443 : 0);
23+
if (proxyPort === 0) {
2424
logger.error(`Invalid proxy URL: ${proxyUrl}. Port is missing. Proceeding without proxy agent.`);
2525
return undefined;
2626
}
@@ -32,7 +32,7 @@ export class AstClient {
3232
const agent = tunnel.httpsOverHttp({
3333
proxy: {
3434
host: proxyUrl.hostname,
35-
port: Number(proxyPort),
35+
port: proxyPort,
3636
proxyAuth,
3737
}
3838
});

0 commit comments

Comments
 (0)