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 {
19
19
20
20
try {
21
21
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 ) {
24
24
logger . error ( `Invalid proxy URL: ${ proxyUrl } . Port is missing. Proceeding without proxy agent.` ) ;
25
25
return undefined ;
26
26
}
@@ -32,7 +32,7 @@ export class AstClient {
32
32
const agent = tunnel . httpsOverHttp ( {
33
33
proxy : {
34
34
host : proxyUrl . hostname ,
35
- port : Number ( proxyPort ) ,
35
+ port : proxyPort ,
36
36
proxyAuth,
37
37
}
38
38
} ) ;
You can’t perform that action at this time.
0 commit comments