File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 23
23
24
24
const http = require ( 'http' ) ;
25
25
const https = require ( 'https' ) ;
26
- const HttpsProxyAgent = require ( 'https-proxy-agent' ) ;
27
- const HttpProxyAgent = require ( 'http-proxy-agent' ) ;
26
+ const { HttpsProxyAgent } = require ( 'https-proxy-agent' ) ;
27
+ const { HttpProxyAgent } = require ( 'http-proxy-agent' ) ;
28
28
const querystring = require ( 'querystring' ) ;
29
29
const url = require ( 'url' ) ;
30
30
Original file line number Diff line number Diff line change 24
24
const fs = require ( 'fs' ) ;
25
25
const http = require ( 'http' ) ;
26
26
const https = require ( 'https' ) ;
27
- const HttpsProxyAgent = require ( 'https-proxy-agent' ) ;
27
+ const { HttpsProxyAgent } = require ( 'https-proxy-agent' ) ;
28
28
const path = require ( 'path' ) ;
29
29
const tar = require ( 'tar' ) ;
30
30
const url = require ( 'url' ) ;
@@ -53,7 +53,10 @@ class Downloader {
53
53
process . env . HTTPS_PROXY ;
54
54
}
55
55
if ( this . proxy ) {
56
- this . agent = new HttpsProxyAgent ( this . proxy ) ;
56
+ const proxy = this . proxy . startsWith ( 'https://' )
57
+ ? this . proxy
58
+ : `https://${ this . proxy } ` ;
59
+ this . agent = new HttpsProxyAgent ( proxy ) ;
57
60
}
58
61
}
59
62
You can’t perform that action at this time.
0 commit comments