Skip to content

Commit

Permalink
Trim port
Browse files Browse the repository at this point in the history
Fixes #83
  • Loading branch information
kornelski committed Oct 6, 2022
1 parent 514e27b commit f490ed2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "crates-index"
description = "Library for retrieving and interacting with the crates.io index"
version = "0.18.9"
version = "0.18.10"
homepage = "https://lib.rs/crates-index"
authors = ["Corey Farwell <coreyf@rwell.org>", "Kornel <kornel@geekhood.net>"]
keywords = ["packaging", "index", "dependencies", "crate", "meta"]
Expand Down
3 changes: 3 additions & 0 deletions src/bare_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ fn url_to_local_dir(url: &str) -> Result<(String, String), Error> {
None => &url[scheme_ind + 3..],
};

// trim port
let host = host.split(':').next().unwrap();

// cargo special cases github.com for reasons, so do the same
let mut canonical = if host == "github.com" {
url.to_lowercase()
Expand Down

0 comments on commit f490ed2

Please sign in to comment.