From d143235a79122f021cb537127dc9dd24073693fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 16 Sep 2019 11:34:51 +0200 Subject: Fix closing of connection on response_body_too_small --- src/cowboy_http.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index 5b07a4c..5136a3b 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -1215,7 +1215,7 @@ stream_terminate(State0=#state{opts=Opts, in_streamid=InStreamID, in_state=InSta info(State0, StreamID, {response, 204, #{}, <<>>}); chunked when Version =:= 'HTTP/1.1' -> info(State0, StreamID, {data, fin, <<>>}); - streaming when ExpectedSize < SentSize -> + streaming when SentSize < ExpectedSize -> terminate(State0, response_body_too_small); _ -> %% done or Version =:= 'HTTP/1.0' State0 -- cgit v1.2.3