diff options
author | Loïc Hoguin <[email protected]> | 2018-11-11 13:57:26 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-11-11 13:57:26 +0100 |
commit | dd0fbab6b79e1cefa31adf6e9647f0d76bbade06 (patch) | |
tree | 595eb0d4ff3af00427598b8d2bb57c371b919d25 /src/cowboy_router.erl | |
parent | d7b7580b3913c17b404319cc4c153748d5e59194 (diff) | |
download | cowboy-dd0fbab6b79e1cefa31adf6e9647f0d76bbade06.tar.gz cowboy-dd0fbab6b79e1cefa31adf6e9647f0d76bbade06.tar.bz2 cowboy-dd0fbab6b79e1cefa31adf6e9647f0d76bbade06.zip |
Add automatic ranged request handling for bytes units
Returning the atom auto instead of a callback informs Cowboy
that it needs to handle range requests automatically. This
changes the behavior so that the ProvideCallback function
is called and then Cowboy splits the data on its own and
sends the response without any other user involvement other
than defining the ranges_provided/2 callback.
This is a quick and dirty way to add range request support
to resources, and will be good enough for many cases including
for cowboy_static as it also works when the normal response
body is a sendfile tuple.
Diffstat (limited to 'src/cowboy_router.erl')
0 files changed, 0 insertions, 0 deletions