mirror of
https://github.com/minio/minio.git
synced 2025-11-06 20:33:07 -05:00
add support for specific error response for InvalidRange (#19668)
fixes #19648 AWS S3 returns the actual object size as part of XML response for InvalidRange error, this is used apparently by SDKs to retry the request without the range.
This commit is contained in:
@@ -595,7 +595,7 @@ type InvalidRange struct {
|
||||
}
|
||||
|
||||
func (e InvalidRange) Error() string {
|
||||
return fmt.Sprintf("The requested range \"bytes %d -> %d of %d\" is not satisfiable.", e.OffsetBegin, e.OffsetEnd, e.ResourceSize)
|
||||
return fmt.Sprintf("The requested range 'bytes=%d-%d' is not satisfiable", e.OffsetBegin, e.OffsetEnd)
|
||||
}
|
||||
|
||||
// ObjectTooLarge error returned when the size of the object > max object size allowed (5G) per request.
|
||||
@@ -758,6 +758,9 @@ func isErrMethodNotAllowed(err error) bool {
|
||||
}
|
||||
|
||||
func isErrInvalidRange(err error) bool {
|
||||
if errors.Is(err, errInvalidRange) {
|
||||
return true
|
||||
}
|
||||
_, ok := err.(InvalidRange)
|
||||
return ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user