aboutsummaryrefslogtreecommitdiffstats
path: root/test/http_SUITE.erl
diff options
context:
space:
mode:
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r--test/http_SUITE.erl17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl
index 25ce595..637bb0d 100644
--- a/test/http_SUITE.erl
+++ b/test/http_SUITE.erl
@@ -73,6 +73,7 @@
-export([stream_body_set_resp/1]).
-export([stream_body_set_resp_close/1]).
-export([te_chunked/1]).
+-export([te_chunked_chopped/1]).
-export([te_chunked_delayed/1]).
-export([te_identity/1]).
@@ -133,6 +134,7 @@ groups() ->
stream_body_set_resp,
stream_body_set_resp_close,
te_chunked,
+ te_chunked_chopped,
te_chunked_delayed,
te_identity
],
@@ -1037,6 +1039,21 @@ te_chunked(Config) ->
{ok, 200, _, Client3} = cowboy_client:response(Client2),
{ok, Body, _} = cowboy_client:response_body(Client3).
+te_chunked_chopped(Config) ->
+ Client = ?config(client, Config),
+ Body = list_to_binary(io_lib:format("~p", [lists:seq(1, 100)])),
+ Body2 = iolist_to_binary(body_to_chunks(50, Body, [])),
+ {ok, Client2} = cowboy_client:request(<<"GET">>,
+ build_url("/echo/body", Config),
+ [{<<"transfer-encoding">>, <<"chunked">>}], Client),
+ {ok, Transport, Socket} = cowboy_client:transport(Client2),
+ _ = [begin
+ ok = Transport:send(Socket, << C >>),
+ ok = timer:sleep(10)
+ end || << C >> <= Body2],
+ {ok, 200, _, Client3} = cowboy_client:response(Client2),
+ {ok, Body, _} = cowboy_client:response_body(Client3).
+
te_chunked_delayed(Config) ->
Client = ?config(client, Config),
Body = list_to_binary(io_lib:format("~p", [lists:seq(1, 100)])),