aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-01-19 17:20:35 +0100
committerLoïc Hoguin <[email protected]>2013-01-19 17:20:35 +0100
commit82de4254ddeff748c28c2086f43fb0d73015932f (patch)
tree6bcf196fc56a78cbfb021c6067dcc73b4e87277d /src
parent645556a80ac1f906a995b107df762756cd105324 (diff)
downloadcowboy-82de4254ddeff748c28c2086f43fb0d73015932f.tar.gz
cowboy-82de4254ddeff748c28c2086f43fb0d73015932f.tar.bz2
cowboy-82de4254ddeff748c28c2086f43fb0d73015932f.zip
Make cowboy_req:has_body/1 return boolean()
This makes it similar to the other has_* functions.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_req.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 4782eed..bf897a3 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -555,11 +555,10 @@ set_meta(Name, Value, Req=#http_req{meta=Meta}) ->
%% Request Body API.
%% @doc Return whether the request message has a body.
--spec has_body(Req) -> {boolean(), Req} when Req::req().
+-spec has_body(cowboy_req:req()) -> boolean().
has_body(Req) ->
- Has = lists:keymember(<<"content-length">>, 1, Req#http_req.headers) orelse
- lists:keymember(<<"transfer-encoding">>, 1, Req#http_req.headers),
- {Has, Req}.
+ lists:keymember(<<"content-length">>, 1, Req#http_req.headers) orelse
+ lists:keymember(<<"transfer-encoding">>, 1, Req#http_req.headers).
%% @doc Return the request message body length, if known.
%%