From 63cc846a104ea6bde57c0d45fbf328e179c28fcd Mon Sep 17 00:00:00 2001 From: Adam Nielsen Date: Sun, 16 Feb 2020 18:52:09 +1000 Subject: [PATCH] Allow use of HTTP proxies listening on port 80 Since port 80 is the default port for the HTTP protocol, `url.port()` returns `None`, causing an "invalid proxy" message. Using `port_or_known_default()` will only return `None` if the both the port has been omitted and an unknown protocol has been specified. --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8ee3b0c..c788b1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -287,7 +287,7 @@ fn setup(args: &[String]) -> Setup { |s| { match Url::parse(&s) { Ok(url) => { - if url.host().is_none() || url.port().is_none() { + if url.host().is_none() || url.port_or_known_default().is_none() { panic!("Invalid proxy url, only urls on the format \"http://host:port\" are allowed"); }