@@ -14,7 +14,8 @@ export abstract class ConfigSource {
14
14
opt_ignoreSSL : boolean ;
15
15
opt_proxy : string ;
16
16
17
- abstract getUrl ( version : string ) : Promise < { url : string , version : string } > ;
17
+ abstract getUrl ( version : string , opt_proxy ?: string , opt_ignoreSSL ?: boolean ) :
18
+ Promise < { url : string , version : string } > ;
18
19
abstract getVersionList ( ) : Promise < string [ ] > ;
19
20
}
20
21
@@ -38,7 +39,7 @@ export abstract class XmlConfigSource extends ConfigSource {
38
39
if ( content != null ) {
39
40
return Promise . resolve ( content ) ;
40
41
}
41
- return this . requestXml ( this . xmlUrl , this . opt_ignoreSSL , this . opt_proxy ) . then ( text => {
42
+ return this . requestXml ( ) . then ( text => {
42
43
let xml = this . convertXml2js ( text ) ;
43
44
fs . writeFileSync ( fileName , text ) ;
44
45
return xml ;
@@ -60,11 +61,11 @@ export abstract class XmlConfigSource extends ConfigSource {
60
61
}
61
62
}
62
63
63
- private requestXml ( url : string , opt_ignoreSSL : boolean , opt_proxy : string ) : Promise < string > {
64
+ private requestXml ( ) : Promise < string > {
64
65
return new Promise < string > ( ( resolve , reject ) => {
65
- let options = HttpUtils . initOptions ( url ) ;
66
- options = HttpUtils . optionsSSL ( options , opt_ignoreSSL ) ;
67
- options = HttpUtils . optionsProxy ( options , url , opt_proxy ) ;
66
+ let options = HttpUtils . initOptions ( this . xmlUrl ) ;
67
+ options = HttpUtils . optionsSSL ( options , this . opt_ignoreSSL ) ;
68
+ options = HttpUtils . optionsProxy ( options , this . xmlUrl , this . opt_proxy ) ;
68
69
69
70
let req = request ( options ) ;
70
71
req . on ( 'response' , response => {
0 commit comments