0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

We accept iodata() when setting cookies; fix that

This commit is contained in:
Loïc Hoguin 2012-12-20 14:36:40 +01:00
parent 8858ca240f
commit 659ca05c54

View file

@ -859,11 +859,11 @@ ce_identity(Data) ->
-spec cookie_to_iodata(iodata(), iodata(), cowboy_req:cookie_opts())
-> iodata().
cookie_to_iodata(Name, Value, Opts) ->
case binary:match(Name, [<<$=>>, <<$,>>, <<$;>>,
case binary:match(iolist_to_binary(Name), [<<$=>>, <<$,>>, <<$;>>,
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
nomatch -> ok
end,
case binary:match(Value, [<<$,>>, <<$;>>,
case binary:match(iolist_to_binary(Value), [<<$,>>, <<$;>>,
<<$\s>>, <<$\t>>, <<$\r>>, <<$\n>>, <<$\013>>, <<$\014>>]) of
nomatch -> ok
end,