Skip to content

Commit

Permalink
do not accept empty or whitespace proxy address (#1423)
Browse files Browse the repository at this point in the history
Closes #1422
  • Loading branch information
vsaase committed Jan 6, 2022
1 parent d4986e5 commit eb8e9d5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/proxy.rs
Expand Up @@ -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 {
Expand Down

0 comments on commit eb8e9d5

Please sign in to comment.