From b6ff8f77584d406e083d6251d7f45ee3ee2e2fba Mon Sep 17 00:00:00 2001 From: Johann150 Date: Fri, 4 Feb 2022 18:23:10 +0100 Subject: [PATCH] fix IRI error handling --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 05d54d5..36cca6d 100644 --- 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 resolved url.set_host(Some(&host.to_string())) .expect("invalid domain?");