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

Fix cowboy_http_req:body with regard to the new accessors default value

header/2 now returns 'undefined' when the header isn't in the request.
This commit is contained in:
Anthony Ramine 2011-03-29 13:55:53 +02:00
parent 150723ca21
commit 4eeabe5612

View file

@ -148,7 +148,7 @@ headers(Req) ->
body(Req) -> body(Req) ->
{Length, Req2} = cowboy_http_req:header('Content-Length', Req), {Length, Req2} = cowboy_http_req:header('Content-Length', Req),
case Length of case Length of
"" -> {error, badarg}; undefined -> {error, badarg};
_Any -> _Any ->
Length2 = list_to_integer(Length), Length2 = list_to_integer(Length),
body(Length2, Req2) body(Length2, Req2)