Parse the given header string where size is the size of the selected
representation that is to be partitioned into subranges. An array of subranges
will be returned or negative numbers indicating an error parsing.
-2 signals a malformed header string
-1 signals an unsatisfiable range
// parse header from requestvar subranges = parseRange(size, req.headers.range)// the type of the subrangesif (subranges.type === 'bytes') { // the ranges subranges.forEach(function (r) { // do something with r.start and r.end })}
Options
These properties are accepted in the options object.
combine
Specifies if overlapping & adjacent subranges should be combined, defaults to
false. When true, ranges will be combined and returned as if they were
specified that way in the header.