aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_protocol.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/cowboy_protocol.erl')
-rw-r--r--src/cowboy_protocol.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/cowboy_protocol.erl b/src/cowboy_protocol.erl
index 22faf1b..3ac967e 100644
--- a/src/cowboy_protocol.erl
+++ b/src/cowboy_protocol.erl
@@ -469,8 +469,9 @@ next_request(Req, State=#state{req_keepalive=Keepalive, timeout=Timeout},
close ->
terminate(State);
_ ->
- Buffer = case cowboy_req:skip_body(Req) of
- {ok, Req2} -> cowboy_req:get(buffer, Req2);
+ %% Skip the body if it is reasonably sized. Close otherwise.
+ Buffer = case cowboy_req:body(Req) of
+ {ok, _, Req2} -> cowboy_req:get(buffer, Req2);
_ -> close
end,
%% Flush the resp_sent message before moving on.