mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Add cowboy_req:filter_cookies/2
This commit is contained in:
parent
5ffb4f98e0
commit
03dac1486d
5 changed files with 126 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue