0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Enable range requests support in cowboy_static

This commit is contained in:
Loïc Hoguin 2018-11-11 16:25:45 +01:00
parent 7840f6db7b
commit fe1ee080de
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764
2 changed files with 18 additions and 0 deletions

View file

@ -838,6 +838,15 @@ priv_file_in_ez_archive(Config) ->
{_, <<"text/html">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
range_request(Config) ->
doc("Confirm that range requests are enabled."),
{206, Headers, <<"less space.\n">>} = do_get("/dir/plain.txt",
[{<<"range">>, <<"bytes=4-">>}], Config),
{_, <<"bytes">>} = lists:keyfind(<<"accept-ranges">>, 1, Headers),
{_, <<"bytes 4-15/16">>} = lists:keyfind(<<"content-range">>, 1, Headers),
{_, <<"application/octet-stream">>} = lists:keyfind(<<"content-type">>, 1, Headers),
ok.
unicode_basic_latin(Config) ->
doc("Get a file with non-urlencoded characters from Unicode Basic Latin block."),
_ = [case do_get("/char/" ++ [C], Config) of