Set `.metadata` suffix on URL path (#2123)

## Summary

Ensures that we don't add the `.metadata` suffix after the fragment, if
it exists.
This commit is contained in:
Charlie Marsh 2024-03-04 12:51:07 -08:00 committed by GitHub
parent 5fed1f6259
commit 14d968ac22
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -389,7 +389,8 @@ impl RegistryClient {
.as_ref()
.is_some_and(pypi_types::DistInfoMetadata::is_available)
{
let url = Url::parse(&format!("{url}.metadata")).map_err(ErrorKind::UrlParseError)?;
let mut url = url.clone();
url.set_path(&format!("{}.metadata", url.path()));
let cache_entry = self.cache.entry(
CacheBucket::Wheels,