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

Remove an unnecessary clause in cowboy_req:body/2

This commit is contained in:
Loïc Hoguin 2013-11-09 18:08:54 +01:00
parent ff4871a9c9
commit a0205779fe

View file

@ -721,13 +721,6 @@ body(Req) ->
%% @doc Return the body sent with the request. %% @doc Return the body sent with the request.
-spec body(non_neg_integer() | infinity, Req) -spec body(non_neg_integer() | infinity, Req)
-> {ok, binary(), Req} | {error, atom()} when Req::req(). -> {ok, binary(), Req} | {error, atom()} when Req::req().
body(infinity, Req) ->
case parse_header(<<"transfer-encoding">>, Req) of
{ok, [<<"identity">>], Req2} ->
read_body(Req2, <<>>);
{ok, _, _} ->
{error, chunked}
end;
body(MaxBodyLength, Req) -> body(MaxBodyLength, Req) ->
case parse_header(<<"transfer-encoding">>, Req) of case parse_header(<<"transfer-encoding">>, Req) of
{ok, [<<"identity">>], Req2} -> {ok, [<<"identity">>], Req2} ->