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:
Harshavardhana
2024-05-05 09:56:21 -07:00
committed by GitHub
parent 8ff70ea5a9
commit 523bd769f1
6 changed files with 61 additions and 29 deletions

View File

@@ -60,7 +60,11 @@ func (h *HTTPRangeSpec) GetLength(resourceSize int64) (rangeLength int64, err er
}
case h.Start >= resourceSize:
return 0, errInvalidRange
return 0, InvalidRange{
OffsetBegin: h.Start,
OffsetEnd: h.End,
ResourceSize: resourceSize,
}
case h.End > -1:
end := h.End