belatuk_range_header 7.0.0
belatuk_range_header: ^7.0.0 copied to clipboard
Range header parser for Dart. Beyond parsing, a stream transformer is included.
Change Log #
7.0.0 #
Breaking changes in 7.0.0 #
- Breaking:
RangeHeader.parserejects a range that ends before it starts, such asbytes=10-5, and text after the last range, such asbytes=0-10 20, with aRangeHeaderParseException. - Breaking:
RangeHeaderTransformerwrites ranges in order of their position in the input and merges overlapping ones, leaves out ranges that start past the end of the input, and cuts back ranges that end past it. - Breaking: The
RangeHeaderTransformerconstructor throws anArgumentErrorwhen none of the ranges can be satisfied, so the server can respond with416 Range Not Satisfiable. - Breaking: The
totalFileSizeargument ofcomputeContentLengthis optional, and it throws anArgumentErrorif it differs fromtotalLength. - Breaking:
toContentRangewrites*for the total size when none is given, and throws when the range's start or end is unknown.
Fixes in 7.0.0 #
- Parsing:
overlapsno longer reports disjoint ranges as overlapping, sobytes=5-10,0-2stays two ranges, and a range inside another is merged in either order. - Parsing: Merging a range with an open-ended one, such as
bytes=0-600,500-, keeps the open end. - Parsing:
RangeHeader.parsehonoursfold: false. - Content-Range:
toContentRangegives the last bytes of the total for a suffix range, such as-500, and cuts an end past the last byte back to it. - Transformer: Each part includes the last byte of its range.
- Transformer: A suffix range, such as
bytes=-500, returns the last bytes of the input, not the first. - Transformer: The
Content-Rangeheader of each part no longer repeats the total size. - Transformer:
computeContentLengthmatches the number of bytes written. - Transformer: An input shorter than
totalLengthfails the output stream and closes it, instead of leaving it open forever, and the input is no longer read after the last range.
6.6.0 #
- Require Dart >= 3.13
6.5.0 #
- Require Dart >= 3.8
6.4.0 #
- Require Dart >= 3.5
- Updated
lintsto 5.0.0
6.3.0 #
- Require Dart >= 3.3
- Updated
lintsto 4.0.0
6.2.0 #
- Updated
lintsto 3.0.0
6.1.0 #
- Updated
fileto 7.0.0
6.0.0 #
- Require Dart >= 3.0
- Updated all dependencies to latest
6.0.0-beta.1 #
- Require Dart >= 3.0
5.0.0 #
- Require Dart >= 2.17
4.0.1 #
- Fixed license link
4.0.0 #
- Upgraded from
pendantictolintslinter - Published as
belatuk_range_headerpackage - Fixed linter warnings
3.0.2 #
- Updated README
3.0.1 #
- Resolve static analysis warnings
3.0.0 #
- Migrated to work with Dart SDK 2.12.x NNBD
2.0.2 #
- Fix bug in
toContentRangethat printed invalid indices. - Fold header items by default.
2.0.1 #
- Adjust
RangeHeaderTransformerto properly print the content range of each item, when multiple are present.
2.0.0 #
- Dart 2 update.
- Add
RangeHeaderTransformer. - Overall restructuring/refactoring.