From fe1ee080de40ee6fd41e17bd71507fefe83f5f3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sun, 11 Nov 2018 16:25:45 +0100 Subject: Enable range requests support in cowboy_static --- test/static_handler_SUITE.erl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test') diff --git a/test/static_handler_SUITE.erl b/test/static_handler_SUITE.erl index 6467f5b..786438a 100644 --- a/test/static_handler_SUITE.erl +++ b/test/static_handler_SUITE.erl @@ -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 -- cgit v1.2.3