diff options
author | Loïc Hoguin <[email protected]> | 2017-01-22 10:50:39 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-01-22 10:50:39 +0100 |
commit | 3e05ab8f82ac69da7c55d1b28284c32ea63186c4 (patch) | |
tree | cc13546e9579d572d7d926aeab73847a4fc56ca5 /test/loop_handler_SUITE.erl | |
parent | 3b91523a3c84a882dcc83f0591b919a939cb72c2 (diff) | |
download | cowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.tar.gz cowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.tar.bz2 cowboy-3e05ab8f82ac69da7c55d1b28284c32ea63186c4.zip |
Add experimental cowboy_compress_h stream handler
Currently marked as experimental because it can't be tweaked
(just enabled/disabled) and because it is not documented yet.
Diffstat (limited to 'test/loop_handler_SUITE.erl')
-rw-r--r-- | test/loop_handler_SUITE.erl | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/test/loop_handler_SUITE.erl b/test/loop_handler_SUITE.erl index 7e26d60..5feb032 100644 --- a/test/loop_handler_SUITE.erl +++ b/test/loop_handler_SUITE.erl @@ -47,41 +47,45 @@ init_dispatch(_) -> long_polling(Config) -> doc("Simple long-polling."), ConnPid = gun_open(Config), - Ref = gun:get(ConnPid, "/long_polling"), + Ref = gun:get(ConnPid, "/long_polling", [{<<"accept-encoding">>, <<"gzip">>}]), {response, fin, 102, _} = gun:await(ConnPid, Ref), ok. long_polling_body(Config) -> doc("Long-polling with a body that falls within the configurable limits."), ConnPid = gun_open(Config), - Ref = gun:post(ConnPid, "/long_polling", [], << 0:5000/unit:8 >>), + Ref = gun:post(ConnPid, "/long_polling", [{<<"accept-encoding">>, <<"gzip">>}], + << 0:5000/unit:8 >>), {response, fin, 102, _} = gun:await(ConnPid, Ref), ok. long_polling_body_too_large(Config) -> doc("Long-polling with a body that exceeds the configurable limits."), ConnPid = gun_open(Config), - Ref = gun:post(ConnPid, "/long_polling", [], << 0:100000/unit:8 >>), + Ref = gun:post(ConnPid, "/long_polling", [{<<"accept-encoding">>, <<"gzip">>}], + << 0:100000/unit:8 >>), {response, fin, 500, _} = gun:await(ConnPid, Ref), ok. long_polling_pipeline(Config) -> doc("Pipeline of long-polling calls."), ConnPid = gun_open(Config), - Refs = [gun:get(ConnPid, "/long_polling") || _ <- lists:seq(1, 2)], + Refs = [gun:get(ConnPid, "/long_polling", [{<<"accept-encoding">>, <<"gzip">>}]) + || _ <- lists:seq(1, 2)], _ = [{response, fin, 102, _} = gun:await(ConnPid, Ref) || Ref <- Refs], ok. loop_body(Config) -> doc("Check that a loop handler can read the request body in info/3."), ConnPid = gun_open(Config), - Ref = gun:post(ConnPid, "/loop_body", [], << 0:100000/unit:8 >>), + Ref = gun:post(ConnPid, "/loop_body", [{<<"accept-encoding">>, <<"gzip">>}], + << 0:100000/unit:8 >>), {response, fin, 200, _} = gun:await(ConnPid, Ref), ok. loop_timeout(Config) -> doc("Ensure that the loop handler timeout results in a 204 response."), ConnPid = gun_open(Config), - Ref = gun:get(ConnPid, "/loop_timeout"), + Ref = gun:get(ConnPid, "/loop_timeout", [{<<"accept-encoding">>, <<"gzip">>}]), {response, fin, 204, _} = gun:await(ConnPid, Ref), ok. |