4
votes

When a client sends a request with a Range header, is it acceptable to just ignore that, and return a 200 OK response with the full content?

The spec says:

If the byte-range-set is unsatisfiable, the server SHOULD return a response with a status of 416 (Requested range not satisfiable). Otherwise, the server SHOULD return a response with a status of 206 (Partial Content) containing the satisfiable ranges of the entity-body.

As I understand it, should implies that it's still acceptable to skip that and return a 200 OK. Am I right?

1
I infer the opposite, I expect that it must return the specified response(s). - James Webster
A server MAY ignore the Range header. in 14.35.2 says that a 200 is ok, since it is what you'd reply with if you did not receive the header. - Joachim Isaksson
No need to infer anything. The definition of SHOULD is spelled out explicitly in RFC 2119. - Sean Bright
@JoachimIsaksson Can you add this as an answer? - BenMorel

1 Answers

2
votes

ยง14.35.2 of the linked spec states;

A server MAY ignore the Range header.

In other words, a 200 with the full contents is a valid reply, since it is what you'd reply with if you did not receive the header.