File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ Revision history for Cro::HTTP
44 - Support link generation
55 - Make http function accept a list of http methods
66 - Catch URI parse errors during routing
7+ - Fix throwing with client-supplied invalid cookie
78
890.8.11
910 - Avoid sending a 0-byte WINDOW_UPDATE frame.
Original file line number Diff line number Diff line change @@ -167,6 +167,15 @@ class Cro::HTTP::Request does Cro::HTTP::Message {
167167 !! @ str [0 ]. value . split (/';' ' ' ? /). List ;
168168 my @ res ;
169169 for @ str {
170+ CATCH {
171+ when X::TypeCheck::Assignment {
172+ # Skip cookies with invalid name or value.
173+ # Since they're received from a client we must not die.
174+ # But neither we're obliged to maintain them.
175+ . rethrow unless . symbol eq ' $!value' | ' $!name' ;
176+ next
177+ }
178+ }
170179 my ($ name , $ value ) = $ _ . split (' =' );
171180 @ res . push : Cro::HTTP::Cookie. new (: $ name , : $ value ) if $ name ;
172181 }
You can’t perform that action at this time.
0 commit comments