0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +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

@ -12,9 +12,9 @@ init(_Transport, Req, []) ->
handle(Req, State) ->
{Method, Req2} = cowboy_req:method(Req),
{HasBody, Req3} = cowboy_req:has_body(Req2),
{ok, Req4} = maybe_echo(Method, HasBody, Req3),
{ok, Req4, State}.
HasBody = cowboy_req:has_body(Req2),
{ok, Req3} = maybe_echo(Method, HasBody, Req2),
{ok, Req3, State}.
maybe_echo(<<"POST">>, true, Req) ->
{ok, PostVals, Req2} = cowboy_req:body_qs(Req),