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

No need for fully qualified call to the same module

This commit is contained in:
Loïc Hoguin 2013-04-11 14:22:16 +02:00
parent 53a48b254f
commit bd9c3df6d0

View file

@ -566,7 +566,7 @@ set_meta(Name, Value, Req=#http_req{meta=Meta}) ->
%% Request Body API. %% Request Body API.
%% @doc Return whether the request message has a body. %% @doc Return whether the request message has a body.
-spec has_body(cowboy_req:req()) -> boolean(). -spec has_body(req()) -> boolean().
has_body(Req) -> has_body(Req) ->
case lists:keyfind(<<"content-length">>, 1, Req#http_req.headers) of case lists:keyfind(<<"content-length">>, 1, Req#http_req.headers) of
{_, <<"0">>} -> {_, <<"0">>} ->
@ -1013,8 +1013,7 @@ reply(Status, Headers, Body, Req=#http_req{
reply_may_compress(Status, Headers, Body, Req, reply_may_compress(Status, Headers, Body, Req,
RespHeaders, HTTP11Headers, Method) -> RespHeaders, HTTP11Headers, Method) ->
BodySize = iolist_size(Body), BodySize = iolist_size(Body),
{ok, Encodings, Req2} {ok, Encodings, Req2} = parse_header(<<"accept-encoding">>, Req),
= cowboy_req:parse_header(<<"accept-encoding">>, Req),
CanGzip = (BodySize > 300) CanGzip = (BodySize > 300)
andalso (false =:= lists:keyfind(<<"content-encoding">>, andalso (false =:= lists:keyfind(<<"content-encoding">>,
1, Headers)) 1, Headers))