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.
Functions
-
parseRangeHeader(
String header) → List< ByteRange> ? -
Parses
header(e.g.bytes=0-499,1000-) into byte ranges, ornullif the unit is notbytesor any range is malformed.