@@ -798,21 +798,21 @@ pub struct ProxyConfig {
798
798
/// A list of no proxy pattern
799
799
#[ serde( default ) ]
800
800
#[ serde( skip_serializing_if = "Vec::is_empty" ) ]
801
- pub no_proxy_domains : Vec < String > ,
801
+ pub non_proxy_hosts : Vec < String > ,
802
802
}
803
803
804
804
impl ProxyConfig {
805
805
pub fn is_default ( & self ) -> bool {
806
- self . https . is_none ( ) && self . https . is_none ( ) && self . no_proxy_domains . is_empty ( )
806
+ self . https . is_none ( ) && self . https . is_none ( ) && self . non_proxy_hosts . is_empty ( )
807
807
}
808
808
pub fn merge ( & self , other : Self ) -> Self {
809
809
Self {
810
810
https : other. https . as_ref ( ) . or ( self . https . as_ref ( ) ) . cloned ( ) ,
811
811
http : other. http . as_ref ( ) . or ( self . http . as_ref ( ) ) . cloned ( ) ,
812
- no_proxy_domains : if other. is_default ( ) {
813
- self . no_proxy_domains . clone ( )
812
+ non_proxy_hosts : if other. is_default ( ) {
813
+ self . non_proxy_hosts . clone ( )
814
814
} else {
815
- other. no_proxy_domains . clone ( )
815
+ other. non_proxy_hosts . clone ( )
816
816
} ,
817
817
}
818
818
}
@@ -1085,7 +1085,7 @@ impl Config {
1085
1085
"proxy-config" ,
1086
1086
"proxy-config.https" ,
1087
1087
"proxy-config.http" ,
1088
- "proxy-config.no -proxy-domains " ,
1088
+ "proxy-config.non -proxy-hosts " ,
1089
1089
]
1090
1090
}
1091
1091
@@ -1205,8 +1205,8 @@ impl Config {
1205
1205
1206
1206
pub fn activate_proxy_envs ( & self ) {
1207
1207
if self . proxy_config . https . is_none ( ) && self . proxy_config . http . is_none ( ) {
1208
- if !self . proxy_config . no_proxy_domains . is_empty ( ) {
1209
- tracing:: info!( "proxy_config.no_proxy_domains is ignored" )
1208
+ if !self . proxy_config . non_proxy_hosts . is_empty ( ) {
1209
+ tracing:: info!( "proxy_config.non_proxy_hosts is ignored" )
1210
1210
}
1211
1211
return ;
1212
1212
}
@@ -1223,7 +1223,7 @@ impl Config {
1223
1223
. find_map ( |& k| std:: env:: var ( k) . ok ( ) . filter ( |v| !v. is_empty ( ) ) ) ;
1224
1224
1225
1225
let config_no_proxy =
1226
- Some ( self . proxy_config . no_proxy_domains . iter ( ) . join ( "," ) ) . filter ( |v| !v. is_empty ( ) ) ;
1226
+ Some ( self . proxy_config . non_proxy_hosts . iter ( ) . join ( "," ) ) . filter ( |v| !v. is_empty ( ) ) ;
1227
1227
1228
1228
if env_https_proxy. is_some ( ) || env_http_proxy. is_some ( ) {
1229
1229
if env_https_proxy. as_deref ( ) != self . proxy_config . https . as_ref ( ) . map ( Url :: as_str)
@@ -1544,8 +1544,8 @@ impl Config {
1544
1544
. transpose ( )
1545
1545
. into_diagnostic ( ) ?;
1546
1546
}
1547
- "no -proxy-domains " => {
1548
- self . proxy_config . no_proxy_domains = value
1547
+ "non -proxy-hosts " => {
1548
+ self . proxy_config . non_proxy_hosts = value
1549
1549
. map ( |v| serde_json:: de:: from_str ( & v) )
1550
1550
. transpose ( )
1551
1551
. into_diagnostic ( ) ?
@@ -2286,7 +2286,7 @@ UNUSED = "unused"
2286
2286
[proxy-config]
2287
2287
https = "http://proxy-for-https"
2288
2288
http = "http://proxy-for-http"
2289
- no -proxy-domains = [ "a.com" ]
2289
+ non -proxy-hosts = [ "a.com" ]
2290
2290
"# ;
2291
2291
let ( config, _) = Config :: from_toml ( toml, None ) . unwrap ( ) ;
2292
2292
assert_eq ! (
@@ -2297,7 +2297,7 @@ UNUSED = "unused"
2297
2297
config. proxy_config. http,
2298
2298
Some ( Url :: parse( "http://proxy-for-http" ) . unwrap( ) )
2299
2299
) ;
2300
- assert_eq ! ( config. proxy_config. no_proxy_domains . len( ) , 1 ) ;
2301
- assert_eq ! ( config. proxy_config. no_proxy_domains [ 0 ] , "a.com" ) ;
2300
+ assert_eq ! ( config. proxy_config. non_proxy_hosts . len( ) , 1 ) ;
2301
+ assert_eq ! ( config. proxy_config. non_proxy_hosts [ 0 ] , "a.com" ) ;
2302
2302
}
2303
2303
}
0 commit comments