mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 20:30:23 +00:00
Fix set-cookie response value check
* Allow a single set-cookie binary as a response header value (assuming the value is a list occurs when it isn't a binary)
This commit is contained in:
parent
2a08250499
commit
983a07c1be
1 changed files with 1 additions and 1 deletions
|
@ -1216,7 +1216,7 @@ commands(State, StreamID, [{push, _, _, _, _, _, _, _}|Tail]) ->
|
|||
commands(State, StreamID, Tail).
|
||||
|
||||
%% The set-cookie header is special; we can only send one cookie per header.
|
||||
headers_to_list(Headers0=#{<<"set-cookie">> := SetCookies}) ->
|
||||
headers_to_list(Headers0=#{<<"set-cookie">> := SetCookies}) when not is_binary(SetCookies) ->
|
||||
Headers1 = maps:to_list(maps:remove(<<"set-cookie">>, Headers0)),
|
||||
Headers1 ++ [{<<"set-cookie">>, Value} || Value <- SetCookies];
|
||||
headers_to_list(Headers) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue