mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Add trailing slash if missing to find-links URL
This commit is contained in:
parent
b2979d25a8
commit
6cd9023dff
1 changed files with 9 additions and 1 deletions
|
@ -162,6 +162,14 @@ impl<'a> FlatIndexClient<'a> {
|
||||||
url: &DisplaySafeUrl,
|
url: &DisplaySafeUrl,
|
||||||
flat_index: &IndexUrl,
|
flat_index: &IndexUrl,
|
||||||
) -> Result<FlatIndexEntries, Error> {
|
) -> Result<FlatIndexEntries, Error> {
|
||||||
|
let mut url = url.clone();
|
||||||
|
url.path_segments_mut()
|
||||||
|
.map_err(|()| ErrorKind::CannotBeABase(flat_index.url().clone()))?
|
||||||
|
.pop_if_empty()
|
||||||
|
// Add a trailing slash to avoid redirect, which is not supported
|
||||||
|
// by some private registries.
|
||||||
|
.push("");
|
||||||
|
|
||||||
let cache_entry = self.cache.entry(
|
let cache_entry = self.cache.entry(
|
||||||
CacheBucket::FlatIndex,
|
CacheBucket::FlatIndex,
|
||||||
"html",
|
"html",
|
||||||
|
@ -179,7 +187,7 @@ impl<'a> FlatIndexClient<'a> {
|
||||||
let flat_index_request = self
|
let flat_index_request = self
|
||||||
.client
|
.client
|
||||||
.uncached()
|
.uncached()
|
||||||
.for_host(url)
|
.for_host(&url)
|
||||||
.get(Url::from(url.clone()))
|
.get(Url::from(url.clone()))
|
||||||
.header("Accept-Encoding", "gzip")
|
.header("Accept-Encoding", "gzip")
|
||||||
.header("Accept", "text/html")
|
.header("Accept", "text/html")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue