aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_req.erl
diff options
context:
space:
mode:
authorAnthony Ramine <[email protected]>2011-03-29 13:55:53 +0200
committerAnthony Ramine <[email protected]>2011-03-29 13:58:03 +0200
commit4eeabe5612aa4ddae1e3fd05b78c6aa4f1aae0e0 (patch)
tree4b904d141968f498e3a5c25a730ce7aca821867d /src/cowboy_http_req.erl
parent150723ca21e3b23ea0d4341d7775a3d03e78e9eb (diff)
downloadcowboy-4eeabe5612aa4ddae1e3fd05b78c6aa4f1aae0e0.tar.gz
cowboy-4eeabe5612aa4ddae1e3fd05b78c6aa4f1aae0e0.tar.bz2
cowboy-4eeabe5612aa4ddae1e3fd05b78c6aa4f1aae0e0.zip
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.
Diffstat (limited to 'src/cowboy_http_req.erl')
-rw-r--r--src/cowboy_http_req.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_http_req.erl b/src/cowboy_http_req.erl
index 8d558b7..498181b 100644
--- a/src/cowboy_http_req.erl
+++ b/src/cowboy_http_req.erl
@@ -148,7 +148,7 @@ headers(Req) ->
body(Req) ->
{Length, Req2} = cowboy_http_req:header('Content-Length', Req),
case Length of
- "" -> {error, badarg};
+ undefined -> {error, badarg};
_Any ->
Length2 = list_to_integer(Length),
body(Length2, Req2)