aboutsummaryrefslogtreecommitdiffstats
path: root/test/examples_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2016-06-14 16:23:51 +0200
committerLoïc Hoguin <[email protected]>2016-06-14 16:23:51 +0200
commit84fb85e2e4bc91d2dfc0da04674d96db34089a05 (patch)
tree386ea385dae9490cab9763387e4b93e9156f7f19 /test/examples_SUITE.erl
parenta55679b231b61e7d2269142efa337ae6face2343 (diff)
downloadcowboy-84fb85e2e4bc91d2dfc0da04674d96db34089a05.tar.gz
cowboy-84fb85e2e4bc91d2dfc0da04674d96db34089a05.tar.bz2
cowboy-84fb85e2e4bc91d2dfc0da04674d96db34089a05.zip
Fix cookie example
Diffstat (limited to 'test/examples_SUITE.erl')
-rw-r--r--test/examples_SUITE.erl18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/examples_SUITE.erl b/test/examples_SUITE.erl
index b946625..6caa7ef 100644
--- a/test/examples_SUITE.erl
+++ b/test/examples_SUITE.erl
@@ -135,6 +135,24 @@ do_chunked_hello_world(Transport, Protocol, Config) ->
ok
end.
+%% Cookie.
+
+cookie(Config) ->
+ doc("Cookie example."),
+ try
+ do_compile_and_start(cookie),
+ do_cookie(tcp, http, Config),
+ do_cookie(tcp, http2, Config)
+ after
+ do_stop(cookie)
+ end.
+
+do_cookie(Transport, Protocol, Config) ->
+ {200, _, One} = do_get(Transport, Protocol, "/", Config),
+ {200, _, Two} = do_get(Transport, Protocol, "/", [{<<"cookie">>, <<"server=abcdef">>}], Config),
+ true = One =/= Two,
+ ok.
+
%% Echo GET.
echo_get(Config) ->