0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 04:30:25 +00:00

Remove unused local function in cowboy_req

This commit is contained in:
Loïc Hoguin 2016-06-22 10:54:22 +02:00
parent 2201b7e423
commit 0e68b2a3f5

View file

@ -1060,15 +1060,6 @@ set([{version, Val}|Tail], Req) -> set(Tail, Req#http_req{version=Val}).
%% Internal. %% Internal.
%% We don't match on "keep-alive" since it is the default value.
-spec connection_to_atom([binary()]) -> keepalive | close.
connection_to_atom([]) ->
keepalive;
connection_to_atom([<<"close">>|_]) ->
close;
connection_to_atom([_|Tail]) ->
connection_to_atom(Tail).
-spec status(cowboy:http_status()) -> binary(). -spec status(cowboy:http_status()) -> binary().
status(100) -> <<"100 Continue">>; status(100) -> <<"100 Continue">>;
status(101) -> <<"101 Switching Protocols">>; status(101) -> <<"101 Switching Protocols">>;
@ -1190,16 +1181,3 @@ filter_constraints(Tail, Map, Key, Value, Constraints) ->
{true, Value2} -> {true, Value2} ->
filter(Tail, Map#{Key => Value2}) filter(Tail, Map#{Key => Value2})
end. end.
%% Tests.
-ifdef(TEST).
connection_to_atom_test_() ->
Tests = [
{[<<"close">>], close},
{[<<"keep-alive">>], keepalive},
{[<<"keep-alive">>, <<"upgrade">>], keepalive}
],
[{lists:flatten(io_lib:format("~p", [T])),
fun() -> R = connection_to_atom(T) end} || {T, R} <- Tests].
-endif.