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:
parent
645556a80a
commit
82de4254dd
3 changed files with 8 additions and 9 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue