Skip to content

Fix registry download URL template expansion - #201

Merged
Byron merged 5 commits into
frewsxcv:masterfrom
syphar:fix-download-url
Sep 3, 2026
Merged

Fix registry download URL template expansion#201
Byron merged 5 commits into
frewsxcv:masterfrom
syphar:fix-download-url

Conversation

@syphar

@syphar syphar commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Fix IndexConfig download URL expansion to match Cargo’s registry-index format.

  • Support the {sha256-checksum} download URL marker.
  • Add IndexConfig::download_url_with_checksum.
  • Make Version::download_url supply the checksum from its index entry.
  • Preserve case for {prefix} and lowercase only {lowerprefix}.
  • Keep sparse-index and local cache paths lowercase, as required by Cargo.
  • Add coverage for download URL templates, mixed-case prefixes, local paths, and sparse crate URLs.

This does not change normal crates.io download URLs or sparse paths. It fixes compatibility with registries that use checksum-based or case-sensitive download URL templates.

@syphar

syphar commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

I stumbled onto this when working on the other fixes.

For docs.rs I don't need the fix, but I thought there is value in it anyways.

@Byron

Byron commented Sep 3, 2026

Copy link
Copy Markdown
Collaborator

Thanks a lot, it's much appreciated!

@Byron
Byron merged commit f455167 into frewsxcv:master Sep 3, 2026
4 checks passed
@syphar
syphar deleted the fix-download-url branch September 3, 2026 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants