Просмотр исходного кода

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.
Anthony Ramine 14 лет назад
Родитель
Сommit
4eeabe5612
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/cowboy_http_req.erl

+ 1 - 1
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)