Fall back to streaming wheel when Content-Length header is absent (#5000)

## Summary

Closes https://github.com/astral-sh/uv/issues/4993
This commit is contained in:
Charlie Marsh 2024-07-11 18:04:21 -07:00 committed by GitHub
parent 55b41d7d3d
commit c345484c93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,6 +61,14 @@ impl Error {
return true; return true;
} }
// The server doesn't support rage requests (it doesn't return the necessary headers).
ErrorKind::AsyncHttpRangeReader(
AsyncHttpRangeReaderError::ContentLengthMissing
| AsyncHttpRangeReaderError::ContentRangeMissing,
) => {
return true;
}
// The server returned a "Method Not Allowed" error, indicating it doesn't support // The server returned a "Method Not Allowed" error, indicating it doesn't support
// HEAD requests, so we can't check for range requests. // HEAD requests, so we can't check for range requests.
ErrorKind::WrappedReqwestError(err) => { ErrorKind::WrappedReqwestError(err) => {