aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers/echo_h.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-10-05 11:23:57 +0200
committerLoïc Hoguin <[email protected]>2019-10-05 11:23:57 +0200
commit03dac1486d72d9d84a3cb99d2040c78b25853257 (patch)
treefaab2aced8c1abb9152e237bc9c7d60c77850bbc /test/handlers/echo_h.erl
parent5ffb4f98e0a8be09675ca508c269b71654294d6a (diff)
downloadcowboy-03dac1486d72d9d84a3cb99d2040c78b25853257.tar.gz
cowboy-03dac1486d72d9d84a3cb99d2040c78b25853257.tar.bz2
cowboy-03dac1486d72d9d84a3cb99d2040c78b25853257.zip
Add cowboy_req:filter_cookies/2
Diffstat (limited to 'test/handlers/echo_h.erl')
-rw-r--r--test/handlers/echo_h.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/handlers/echo_h.erl b/test/handlers/echo_h.erl
index 7d0e75b..1b672d1 100644
--- a/test/handlers/echo_h.erl
+++ b/test/handlers/echo_h.erl
@@ -92,6 +92,10 @@ echo(<<"match">>, Req, Opts) ->
Match
end,
{ok, cowboy_req:reply(200, #{}, value_to_iodata(Value), Req), Opts};
+echo(<<"filter_then_parse_cookies">>, Req0, Opts) ->
+ Req = cowboy_req:filter_cookies([cake, color], Req0),
+ Value = cowboy_req:parse_cookies(Req),
+ {ok, cowboy_req:reply(200, #{}, value_to_iodata(Value), Req), Opts};
echo(What, Req, Opts) ->
Key = binary_to_atom(What, latin1),
Value = case cowboy_req:path(Req) of