parsing/range_header_utils library

Parse an HTTP Range request header (bytes= unit only). Roadmap #160.

Supports the forms a server needs for partial content: bytes=0-499 (explicit), bytes=500- (open-ended, to end of resource), bytes=-500 (suffix, last N bytes), and comma-separated multi-range. Only the bytes unit is recognized; any other unit or a malformed spec yields null so the caller can answer 416 Range Not Satisfiable instead of guessing.

Classes

ByteRange
One requested byte range. Exactly one of start/end may be null:

Functions

parseRangeHeader(String header) List<ByteRange>?
Parses header (e.g. bytes=0-499,1000-) into byte ranges, or null if the unit is not bytes or any range is malformed.