mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix cookie example
This commit is contained in:
parent
a55679b231
commit
84fb85e2e4
3 changed files with 26 additions and 8 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue