From f26c2c57e416b252e5cc64faff51a22a93e75bd8 Mon Sep 17 00:00:00 2001 From: Fabrice Reix Date: Wed, 17 Nov 2021 11:51:33 +0100 Subject: [PATCH] Support invalid urls in curl export (verbose) --- packages/hurl/src/http/client.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/hurl/src/http/client.rs b/packages/hurl/src/http/client.rs index ecf56fc6e..ad53a4b02 100644 --- a/packages/hurl/src/http/client.rs +++ b/packages/hurl/src/http/client.rs @@ -554,7 +554,10 @@ pub fn all_cookies(cookie_storage: Vec, request: &RequestSpec) -> Vec bool { // is it possible to do it with libcurl? - let url = Url::parse(url).expect("valid url"); + let url = match Url::parse(url) { + Ok(url) => url, + Err(_) => return false, + }; if let Some(domain) = url.domain() { if cookie.include_subdomain == "FALSE" { if cookie.domain != domain {