Yup, completely agree. I find the 416 also a bit surprising, whether in 
Ceph/RGW or plain HTTP.
But I guess it’s just consistent with specifying a range of 1-100 on a one-byte 
object or any range that can’t be satisfied.
After all, the range is part of the request and 4xx means “something wrong with 
your request”.

Just to make sure: I am not at all involved in Ceph development, so don’t send 
a feature request to me :)

Ciao, Uli

> On 22. 03 2022, at 09:23, Kai Stian Olstad <[email protected]> wrote:
> 
> On 21.03.2022 15:35, Ulrich Klein wrote:
>> RFC 7233
>> 4.4 <https://datatracker.ietf.org/doc/html/rfc7233#section-4.4>.  416
>> Range Not Satisfiable
>>   The 416 (Range Not Satisfiable) status code indicates that none of
>>   the ranges in the request's Range header field (Section 3.1
>> <https://datatracker.ietf.org/doc/html/rfc7233#section-3.1>) overlap
> 
> The section 3.1 say "A server MAY ignore the Range header field."
> 
> 
>>   For example:
>>     HTTP/1.1 416 Range Not Satisfiable
>>     Date: Fri, 20 Jan 2012 15:41:54 GMT
>>     Content-Range: bytes */47022
>>      Note: Because servers are free to ignore Range, many
>>      implementations will simply respond with the entire selected
>>      representation in a 200 (OK) response.  That is partly because
> 
> This is what Nginx and Apache do, if you specify range when the file has 0 
> bytes they will return 200.
> So they are ignore range with 0 bytes files but not when the bytes is grater 
> than 0.
> 
> 
>>> On 21. 03 2022, at 15:11, Ulrich Klein <[email protected]> wrote:
>>> With a bit of HTTP background I’d say:
>>> bytes=0-1000000 means: First byte to to 1000000nd byte. First byte is byte 
>>> #0
>>> On an empty object there is no first byte, i.e. not satisfiable ==> 416
>>> Should be the same as on a single byte object and
>>> bytes=1-1000000
>>> 200 OK should only be correct, if the server or a proxy in between doesn’t 
>>> support range requests.
> 
> After reading your text and links I do concur that returning 416 with 0 bytes 
> with range bytes=0-1000000 is not wrong,
> but I also believe that it would be correct to return 200 OK as Nginx and 
> Apache do, since range can be ignored.
> 
> I think our user of Ceph is used to how Nginx and Apache works and that is 
> the reason they wondered if it was something wrong with Ceph.
> 
> So I think the answer to them will be, It's according to spec but you can 
> always put in a feature request.
> 
> 
> -- 
> Kai Stian Olstad

_______________________________________________
ceph-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to