aboutsummaryrefslogtreecommitdiffstats
path: root/test/req_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2024-01-08 15:13:18 +0100
committerLoïc Hoguin <[email protected]>2024-01-08 15:13:18 +0100
commite4a78aaeb110a3eda5269b618230b8bcb18fbcc2 (patch)
tree9c85e90adbe50b118ba0846473b17929bbda5e7d /test/req_SUITE.erl
parentc1490d7d5503636e7995583222cf8edf5f882db5 (diff)
downloadcowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.tar.gz
cowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.tar.bz2
cowboy-e4a78aaeb110a3eda5269b618230b8bcb18fbcc2.zip
Document body reading in auto mode
It is now tested both via cowboy_req:read_body and via cowboy_req:cast. Removes a bad example from the guide of body reading with period of infinity, which does not work.
Diffstat (limited to 'test/req_SUITE.erl')
-rw-r--r--test/req_SUITE.erl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/req_SUITE.erl b/test/req_SUITE.erl
index d608767..92c8092 100644
--- a/test/req_SUITE.erl
+++ b/test/req_SUITE.erl
@@ -64,6 +64,8 @@ init_dispatch(Config) ->
{"/opts/:key/timeout", echo_h, #{timeout => 1000, crash => true}},
{"/100-continue/:key", echo_h, []},
{"/full/:key", echo_h, []},
+ {"/auto-sync/:key", echo_h, []},
+ {"/auto-async/:key", echo_h, []},
{"/spawn/:key", echo_h, []},
{"/no/:key", echo_h, []},
{"/direct/:key/[...]", echo_h, []},
@@ -524,6 +526,12 @@ do_read_body_timeout(Path, Body, Config) ->
{response, _, 500, _} = gun:await(ConnPid, Ref, infinity),
gun:close(ConnPid).
+read_body_auto(Config) ->
+ doc("Read the request body using auto mode."),
+ <<0:80000000>> = do_body("POST", "/auto-sync/read_body", [], <<0:80000000>>, Config),
+ <<0:80000000>> = do_body("POST", "/auto-async/read_body", [], <<0:80000000>>, Config),
+ ok.
+
read_body_spawn(Config) ->
doc("Confirm we can use cowboy_req:read_body/1,2 from another process."),
<<"hello world!">> = do_body("POST", "/spawn/read_body", [], "hello world!", Config),