From d2205d9ea6aa71ff256c48667755676d0e6c2377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Mon, 16 Feb 2015 19:49:01 +0100 Subject: Do not send empty chunks User code may sometimes send an empty value which gets understood by the client as being the end of the stream while this was not intended. Ignoring empty values allow making sure the stream isn't ended by mistake. --- test/http_SUITE_data/http_chunked.erl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'test') diff --git a/test/http_SUITE_data/http_chunked.erl b/test/http_SUITE_data/http_chunked.erl index 87a6852..6433f66 100644 --- a/test/http_SUITE_data/http_chunked.erl +++ b/test/http_SUITE_data/http_chunked.erl @@ -6,6 +6,8 @@ init(Req, Opts) -> Req2 = cowboy_req:chunked_reply(200, Req), + %% Try an empty chunk to make sure the stream doesn't get closed. + cowboy_req:chunk([<<>>], Req2), timer:sleep(100), cowboy_req:chunk("chunked_handler\r\n", Req2), timer:sleep(100), -- cgit v1.2.3