aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http_protocol.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_http_protocol.erl')
-rw-r--r--src/cowboy_http_protocol.erl7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/cowboy_http_protocol.erl b/src/cowboy_http_protocol.erl
index ecc7286..04abfbc 100644
--- a/src/cowboy_http_protocol.erl
+++ b/src/cowboy_http_protocol.erl
@@ -396,10 +396,9 @@ next_request(Req=#http_req{connection=Conn},
ensure_body_processed(#http_req{body_state=done, buffer=Buffer}) ->
{ok, Buffer};
ensure_body_processed(Req=#http_req{body_state=waiting}) ->
- case cowboy_http_req:body(Req) of
- {error, badarg} -> {ok, Req#http_req.buffer}; %% No body.
- {error, _Reason} -> {close, <<>>};
- {ok, _, Req2} -> {ok, Req2#http_req.buffer}
+ case cowboy_http_req:skip_body(Req) of
+ {ok, Req2} -> {ok, Req2#http_req.buffer};
+ {error, _Reason} -> {close, <<>>}
end;
ensure_body_processed(Req=#http_req{body_state={multipart, _, _}}) ->
{ok, Req2} = cowboy_http_req:multipart_skip(Req),