From 38180e70f615a14c671eb58fd0123d33a0a128e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=A3rebe=20-=20Romain=20GERARD?= Date: Sun, 15 Dec 2024 09:27:47 +0100 Subject: [PATCH] fix(cmd_line): correctly parse port when it is 443 --- src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index dc7c10e..d2bdf16 100644 --- a/src/main.rs +++ b/src/main.rs @@ -459,11 +459,16 @@ fn parse_tunnel_dest(remaining: &str) -> Result<(Host, u16, BTreeMap remote_port, + // the url lib does not parse the port if it is the default one + None if remaining.ends_with(":443") => 443, + _ => { + return Err(Error::new( + ErrorKind::InvalidInput, + format!("cannot parse remote port from {}", remaining), + )) + } }; let options: BTreeMap = remote.query_pairs().into_owned().collect();