angel3_range_header 3.0.1 copy "angel3_range_header: ^3.0.1" to clipboard
angel3_range_header: ^3.0.1 copied to clipboard

discontinuedreplaced by: belatuk_range_header
outdated

Range header parser for Dart. Beyond parsing, a stream transformer is included.

angel3_range_header #

version Null Safety Gitter

License

Range header parser for Dart.

Installation #

In your pubspec.yaml:

dependencies:
  angel3_range_header: ^3.0.0

Usage #

handleRequest(HttpRequest request) async {
  // Parse the header
  var header = RangeHeader.parse(request.headers.value(HttpHeaders.rangeHeader));

  // Optimize/canonicalize it
  var items = RangeHeader.foldItems(header.items);
  header = RangeHeader(items);

  // Get info
  header.items;
  header.rangeUnit;
  print(header.items[0].toContentRange(fileSize));

  // Serve the file
  var transformer = RangeHeaderTransformer(header);
  await file.openRead().transform(transformer).pipe(request.response);
}
0
likes
0
pub points
0%
popularity

Publisher

verified publisherdukefirehawk.com

Range header parser for Dart. Beyond parsing, a stream transformer is included.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

async, charcode, quiver, source_span, string_scanner

More

Packages that depend on angel3_range_header