aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE_data
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-02-16 19:49:01 +0100
committerLoïc Hoguin <[email protected]>2015-02-16 19:49:01 +0100
commitd2205d9ea6aa71ff256c48667755676d0e6c2377 (patch)
tree1a3aeeafa833da3d1fcbfb67af6224ce077c5e23 /test/http_SUITE_data
parent8d2063bb2ea8fec3f1807cd8181cbe25689838f1 (diff)
downloadcowboy-d2205d9ea6aa71ff256c48667755676d0e6c2377.tar.gz
cowboy-d2205d9ea6aa71ff256c48667755676d0e6c2377.tar.bz2
cowboy-d2205d9ea6aa71ff256c48667755676d0e6c2377.zip
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.
Diffstat (limited to 'test/http_SUITE_data')
-rw-r--r--test/http_SUITE_data/http_chunked.erl2
1 files changed, 2 insertions, 0 deletions
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),