do not accept empty or whitespace proxy address (#1423)

Closes #1422
This commit is contained in:
Victor Saase
2022-01-06 19:49:40 +01:00
committed by GitHub
parent d4986e5583
commit eb8e9d52c5

View File

@@ -775,7 +775,10 @@ fn get_sys_proxies(
}
fn insert_proxy(proxies: &mut SystemProxyMap, scheme: impl Into<String>, addr: String) -> bool {
if let Ok(valid_addr) = addr.into_proxy_scheme() {
if addr.trim().is_empty() {
// do not accept empty or whitespace proxy address
false
} else if let Ok(valid_addr) = addr.into_proxy_scheme() {
proxies.insert(scheme.into(), valid_addr);
true
} else {