File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff 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 } ) ;
You can’t perform that action at this time.
0 commit comments