当客户端发送带有 Range 的请求时 header ,是否可以忽略它并返回包含完整内容的 200 OK
响应?
规范说:
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.
据我了解,应该 意味着跳过它并返回 200 OK
仍然是可以接受的。我说得对吗?
最佳答案
§14.35.2链接的规范状态;
A server MAY ignore the Range header.
换句话说,包含完整内容的 200 是一个有效的回复,因为如果您没有收到标题,您将使用它来回复。
关于http - 使用 200 响应代码回复 Range 请求是否可以接受?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16841529/