mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
We accept iodata() when setting cookies; fix that
This commit is contained in:
parent
8858ca240f
commit
659ca05c54
1 changed files with 2 additions and 2 deletions
|
@ -859,11 +859,11 @@ ce_identity(Data) ->
|
||||||
-spec cookie_to_iodata(iodata(), iodata(), cowboy_req:cookie_opts())
|
-spec cookie_to_iodata(iodata(), iodata(), cowboy_req:cookie_opts())
|
||||||
-> iodata().
|
-> iodata().
|
||||||
cookie_to_iodata(Name, Value, Opts) ->
|
cookie_to_iodata(Name, Value, Opts) ->
|
||||||
case binary:match(Name, [<<$=>>, <<$,>>, <<$;>>,
|
case binary:match(iolist_to_binary(Name), [<<$=>>, <<$,>>, <<$;>>,
|
||||||
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
|
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
|
||||||
nomatch -> ok
|
nomatch -> ok
|
||||||
end,
|
end,
|
||||||
case binary:match(Value, [<<$,>>, <<$;>>,
|
case binary:match(iolist_to_binary(Value), [<<$,>>, <<$;>>,
|
||||||
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
|
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
|
||||||
nomatch -> ok
|
nomatch -> ok
|
||||||
end,
|
end,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue