mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-19 02:56:18 +00:00
fix(utils): harden panic-prone paths (#2113)
Signed-off-by: houseme <housemecn@gmail.com> Co-authored-by: houseme <housemecn@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: heihutu <30542132+heihutu@users.noreply.github.com>
This commit is contained in:
@@ -200,8 +200,8 @@ impl std::fmt::Display for ParsedURL {
|
||||
&& let Some(port) = url.port()
|
||||
&& ((url.scheme() == "http" && port == 80) || (url.scheme() == "https" && port == 443))
|
||||
{
|
||||
url.set_host(Some(&host)).unwrap();
|
||||
url.set_port(None).unwrap();
|
||||
let _ = url.set_host(Some(&host));
|
||||
let _ = url.set_port(None);
|
||||
}
|
||||
let mut s = url.to_string();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user