Skip to content

Commit

Permalink
Fallback to GET on HTTP 400 when attempting to use range requests f…
Browse files Browse the repository at this point in the history
…or wheel download (#11539)

See #11501
  • Loading branch information
zanieb authored Feb 16, 2025
1 parent 47fb59f commit 346e6b7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/uv-client/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit 346e6b7

Please sign in to comment.