This repository has been archived by the owner. It is now read-only.
[DEPRECATED] Rolled into package:angel_static in Angel 2.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea/runConfigurations
lib
test
.gitignore
.travis.yml
LICENSE
README.md
pubspec.yaml

README.md

DEPRECATED

Angel 2's version of package:angel_static includes range header support out-of-the-box, rather than requiring a separate package.

range

Pub build status coverage: 100%

Support for handling the Range headers using the Angel framework. Aiming for 100% compliance with the Range specification.

Installation

In your pubspec.yaml:

dependencies:
  angel_framework: ^1.0.0
  angel_range: ^1.0.0

Usage

The acceptRanges() function returns an Angel request handler. This is best used as a response finalizer.

Compression

If you are using response compression in your application, make sure to add it after Range support. Save yourself a headache!

configureServer(Angel app) async {
  // Apply `Range` headers, if need be
  app.responseFinalizers.add(acceptRanges());
  
  // Support gzip, deflate compression
  app.responseFinalizers.addAll([gzip(), deflate()]);
}