fix IRI error handling

This commit is contained in:
Johann150 2022-02-04 18:23:10 +01:00
parent a9ccbb07c9
commit b6ff8f7758
No known key found for this signature in database
GPG key ID: 9EE6577A2A06F8F1

View file

@ -455,9 +455,9 @@ impl RequestHandle {
let host = Host::parse( let host = Host::parse(
&percent_decode_str(domain) &percent_decode_str(domain)
.decode_utf8() .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 // TODO: simplify when <https://github.com/servo/rust-url/issues/586> resolved
url.set_host(Some(&host.to_string())) url.set_host(Some(&host.to_string()))
.expect("invalid domain?"); .expect("invalid domain?");