aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_static.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_static.erl')
-rw-r--r--src/cowboy_static.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/cowboy_static.erl b/src/cowboy_static.erl
index 335c6ae..29ac809 100644
--- a/src/cowboy_static.erl
+++ b/src/cowboy_static.erl
@@ -20,6 +20,7 @@
-export([forbidden/2]).
-export([content_types_provided/2]).
-export([charsets_provided/2]).
+-export([ranges_provided/2]).
-export([resource_exists/2]).
-export([last_modified/2]).
-export([generate_etag/2]).
@@ -340,6 +341,14 @@ charsets_provided(Req, State={Path, _, Extra}) ->
{[Charset], Req, State}
end.
+%% Enable support for range requests.
+
+-spec ranges_provided(Req, State)
+ -> {[{binary(), auto}], Req, State}
+ when State::state().
+ranges_provided(Req, State) ->
+ {[{<<"bytes">>, auto}], Req, State}.
+
%% Assume the resource doesn't exist if it's not a regular file.
-spec resource_exists(Req, State)