aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMirjam Friesen <[email protected]>2024-04-02 13:33:35 +0200
committerLoïc Hoguin <[email protected]>2025-02-06 13:23:08 +0100
commit36f42a5e8bfb9ae1b991e3b6b92c85ce685e3301 (patch)
tree1492fd67e7af748ed77422bd2e7bf134bd9a67c1 /src
parent8e121d138c4f658cf0953eeeeea85d07c203a5b6 (diff)
downloadcowboy-36f42a5e8bfb9ae1b991e3b6b92c85ce685e3301.tar.gz
cowboy-36f42a5e8bfb9ae1b991e3b6b92c85ce685e3301.tar.bz2
cowboy-36f42a5e8bfb9ae1b991e3b6b92c85ce685e3301.zip
Fix cowboy_req:filter_cookies missing valid cookies
When 3 or more cookies were sent the extra cookies were not found because the binary:split on ";" stopped at the first occurrence.
Diffstat (limited to 'src')
-rw-r--r--src/cowboy_req.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cowboy_req.erl b/src/cowboy_req.erl
index 3f87677..8d8cf82 100644
--- a/src/cowboy_req.erl
+++ b/src/cowboy_req.erl
@@ -462,7 +462,7 @@ filter_cookies(Names0, Req=#{headers := Headers}) ->
case header(<<"cookie">>, Req) of
undefined -> Req;
Value0 ->
- Cookies0 = binary:split(Value0, <<$;>>),
+ Cookies0 = binary:split(Value0, <<$;>>, [global]),
Cookies = lists:filter(fun(Cookie) ->
lists:member(cookie_name(Cookie), Names)
end, Cookies0),