I'm working on a project which manually parses the Range: ... field. On an error, it always returns a 416 HTTP error (Range Not Satisfiable).
It seems to me that in most cases, like where the range is not bytes=... or a number is invalid, the HTTP error should instead be 400.
Have you had experience with this specific case before? What are we expected to return?
At the risk of an opinion-like answer: RFC 7233 discusses 416 in the context of being unable to satisfy a range request, with the strong implication that the request is syntactically correct.
https://www.rfc-editor.org/rfc/rfc7233#page-15
Errors in request syntax or otherwise malformed still correspond to a general 400 Bad Request.
https://www.rfc-editor.org/rfc/rfc7231#page-58
So, if the request doesn’t specify valid
bytesranges (currently the only registered range type) I’d return a 400.