Skip to content

Commit

Permalink
fix: handle url changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig committed Aug 27, 2023
1 parent b71072c commit 129428b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/builder/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lychee-bin/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub(crate) fn create(cfg: &Config, cookie_jar: Option<&Arc<CookieStoreMutex>>) -

// Offline mode overrides the scheme
let schemes = if cfg.offline {
vec!["file".to_string()]
vec!["file:".to_string()]
} else {
cfg.scheme.clone()
};
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion lychee-lib/src/types/file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
})
}

Expand Down

0 comments on commit 129428b

Please sign in to comment.