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

Make cowboy_req:has_body/1 return boolean()

This makes it similar to the other has_* functions.
This commit is contained in:
Loïc Hoguin 2013-01-19 17:20:35 +01:00
parent 645556a80a
commit 82de4254dd
3 changed files with 8 additions and 9 deletions

View file

@ -8,8 +8,8 @@ init({_, http}, Req, _) ->
{ok, Req, undefined}.
handle(Req, State) ->
{true, Req1} = cowboy_req:has_body(Req),
{ok, Body, Req2} = cowboy_req:body(Req1),
true = cowboy_req:has_body(Req),
{ok, Body, Req2} = cowboy_req:body(Req),
{Size, Req3} = cowboy_req:body_length(Req2),
Size = byte_size(Body),
{ok, Req4} = cowboy_req:reply(200, [], Body, Req3),