mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Newly documented cow_cookie:cookie_opts() is now a map
This commit is contained in:
parent
d52e84bdd9
commit
ecb39eea10
1 changed files with 2 additions and 7 deletions
|
@ -98,10 +98,6 @@
|
|||
%% Internal.
|
||||
-export([response_headers/2]).
|
||||
|
||||
%% @todo Get rid of this type, use cow_cookie directly.
|
||||
-type cookie_opts() :: map().
|
||||
-export_type([cookie_opts/0]).
|
||||
|
||||
-type read_body_opts() :: #{
|
||||
length => non_neg_integer() | infinity,
|
||||
period => non_neg_integer(),
|
||||
|
@ -704,11 +700,10 @@ set_resp_cookie(Name, Value, Req) ->
|
|||
%%
|
||||
%% The cookie value cannot contain any of the following characters:
|
||||
%% ,; \t\r\n\013\014
|
||||
%% @todo Fix the cookie_opts() type.
|
||||
-spec set_resp_cookie(binary(), iodata(), Req, cookie_opts())
|
||||
-spec set_resp_cookie(binary(), iodata(), Req, cow_cookie:cookie_opts())
|
||||
-> Req when Req::req().
|
||||
set_resp_cookie(Name, Value, Req, Opts) ->
|
||||
Cookie = cow_cookie:setcookie(Name, Value, maps:to_list(Opts)),
|
||||
Cookie = cow_cookie:setcookie(Name, Value, Opts),
|
||||
RespCookies = maps:get(resp_cookies, Req, #{}),
|
||||
Req#{resp_cookies => RespCookies#{Name => Cookie}}.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue