mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Revert "don't error when asked for 0-based range on empty objects (#17708)"
This reverts commit 7e76d66184
.
There is no valid way to specify offsets in a 0-byte file. Blame it on the [RFC](https://datatracker.ietf.org/doc/html/rfc7233#section-4.4)
> The 416 (Range Not Satisfiable) status code indicates that none of the ranges in the
> request's Range header field (Section 3.1) overlap the current extent of the selected resource...
A request for "bytes=0-" is a request for the first byte of a resource. If the resource is 0-length,
the range [0,0] does not overlap the resource content and the server responds with an error.
This commit is contained in:
parent
7e76d66184
commit
2da4bd5f1a
@ -59,9 +59,6 @@ func (h *HTTPRangeSpec) GetLength(resourceSize int64) (rangeLength int64, err er
|
||||
rangeLength = resourceSize
|
||||
}
|
||||
|
||||
case h.Start == 0 && resourceSize == 0:
|
||||
rangeLength = resourceSize
|
||||
|
||||
case h.Start >= resourceSize:
|
||||
return 0, errInvalidRange
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user