diff --git a/examples/builder/builder.rs b/examples/builder/builder.rs index 8ff9dd9075..c943c3accd 100644 --- a/examples/builder/builder.rs +++ b/examples/builder/builder.rs @@ -32,8 +32,8 @@ async fn main() -> Result<()> { .method(Method::HEAD) .timeout(Duration::from_secs(5)) .schemes(HashSet::from_iter(vec![ - "http".to_string(), - "https".to_string(), + "http:".to_string(), + "https:".to_string(), ])) .accepted(accepted) .build() diff --git a/lychee-bin/src/client.rs b/lychee-bin/src/client.rs index e2297c8ea5..670340e1b4 100644 --- a/lychee-bin/src/client.rs +++ b/lychee-bin/src/client.rs @@ -21,7 +21,7 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc>) - // Offline mode overrides the scheme let schemes = if cfg.offline { - vec!["file".to_string()] + vec!["file:".to_string()] } else { cfg.scheme.clone() }; diff --git a/lychee-lib/src/test_utils.rs b/lychee-lib/src/test_utils.rs index 1a44c02ec5..dc79f58925 100644 --- a/lychee-lib/src/test_utils.rs +++ b/lychee-lib/src/test_utils.rs @@ -44,7 +44,7 @@ pub(crate) fn mail(address: &str) -> Uri { if address.starts_with("mailto:") { Url::parse(address, None) } else { - Url::parse(&(String::from("mailto:") + address), None) + Url::parse(address, Some("mailto:")) } .expect("Expected valid Mail Address") .into() diff --git a/lychee-lib/src/types/file.rs b/lychee-lib/src/types/file.rs index a375053a7e..98ae2546f9 100644 --- a/lychee-lib/src/types/file.rs +++ b/lychee-lib/src/types/file.rs @@ -59,7 +59,7 @@ fn is_url(path: &Path) -> bool { path.to_str() .and_then(|s| Url::parse(s, None).ok()) .map_or(false, |url| { - url.protocol() == "http" || url.protocol() == "https" + url.protocol() == "http:" || url.protocol() == "https:" }) }