Fallback to `GET` on HTTP 400 when attempting to use range requests for wheel download (#11539)

See https://github.com/astral-sh/uv/issues/11501
This commit is contained in:
Zanie Blue 2025-02-15 22:02:46 -06:00 committed by GitHub
parent 47fb59fdab
commit 346e6b7e8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -98,6 +98,12 @@ impl Error {
if status == reqwest::StatusCode::FORBIDDEN {
return true;
}
// In some cases, registries (like Alibaba Cloud) return a 400 for HEAD requests
// when they're not supported. Again, it's better to be lenient here.
if status == reqwest::StatusCode::BAD_REQUEST {
return true;
}
}
}