frewsxcv / rust-crates-index

Rust library for retrieving and interacting with the crates.io index
https://docs.rs/crates-index/
Apache License 2.0
72 stars 37 forks source link

Add CRATES_IO_HTTP_INDEX #115

Closed Jake-Shadle closed 1 year ago

Jake-Shadle commented 1 year ago

Also moves the git index url to the bare_index for clarity

This also fixes 2 bugs:

  1. The SparseIndex::from_url was not validating that the url started with sparse+, which is required as it is part of the hash calculation and would result in incorrect disk locations if the user forgot to add that in the url
  2. The hash calculation was incorrect, in cargo, only git registries use the hash of the canonicalized url for the ident, all other registry kinds just hash the raw url