Mobile app version of vmapp.org
Login or Join
Angela700

: How lenient should I be when checking the range header parameters? I made more of my URLs now accept the HTTP range request so that only user requested bytes of the document can be parsed.

@Angela700

Posted in: #Http #HttpHeaders

I made more of my URLs now accept the HTTP range request so that only user requested bytes of the document can be parsed. This is the range header my code supports:

range: bytes=s-e


where s is the lowest byte value and e is the highest, thus causing a range.

Currently, if I request the range in the following format:

range: bytes =s-e


I return the 416 "range not satisfiable" status code.

Is it acceptable to return an error if bytes contains spaces after it or should I assume all browsers are so messed up to the point where they could craft any of the following range headers in their request:

range: s-e
range: b = s-e
range: chars = s-e
range: numbers = s-e
range: bytes : s-e


I want to try to make the browser with the worst set of bugs work with my website so I'm trying to understand how lenient I should be when validating the range request.

Any ideas?

10% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

0 Comments

Sorted by latest first Latest Oldest Best

Back to top | Use Dark Theme