commit b6ff8f77584d406e083d6251d7f45ee3ee2e2fba
parent a9ccbb07c94f3c03213e58567b47e41501d2e0bb
Author: Johann150 <johann.galle@protonmail.com>
Date: Fri, 4 Feb 2022 18:23:10 +0100
fix IRI error handling
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/main.rs b/src/main.rs
@@ -455,9 +455,9 @@ impl RequestHandle {
let host = Host::parse(
&percent_decode_str(domain)
.decode_utf8()
- .expect("invalid domain?"),
+ .or(Err((59, "Invalid URL")))?,
)
- .expect("invalid domain?");
+ .or(Err((59, "Invalid URL")))?;
// TODO: simplify when <https://github.com/servo/rust-url/issues/586> resolved
url.set_host(Some(&host.to_string()))
.expect("invalid domain?");