Support invalid urls in curl export (verbose)

This commit is contained in:
Fabrice Reix 2021-11-17 11:51:33 +01:00 committed by Fabrice Reix
parent e46d44b4a8
commit f26c2c57e4

View File

@ -554,7 +554,10 @@ pub fn all_cookies(cookie_storage: Vec<Cookie>, request: &RequestSpec) -> Vec<Re
///
pub fn match_cookie(cookie: &Cookie, url: &str) -> 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 {