Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Revision history for Cro::HTTP
- Support link generation
- Make http function accept a list of http methods
- Catch URI parse errors during routing
- Fix throwing with client-supplied invalid cookie

0.8.11
- Avoid sending a 0-byte WINDOW_UPDATE frame.
Expand Down
9 changes: 9 additions & 0 deletions lib/Cro/HTTP/Request.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,15 @@ class Cro::HTTP::Request does Cro::HTTP::Message {
!! @str[0].value.split(/';' ' '?/).List;
my @res;
for @str {
CATCH {
when X::TypeCheck::Assignment {
# Skip cookies with invalid name or value.
# Since they're received from a client we must not die.
# But neither we're obliged to maintain them.
.rethrow unless .symbol eq '$!value' | '$!name';
next
}
}
my ($name, $value) = $_.split('=');
@res.push: Cro::HTTP::Cookie.new(:$name, :$value) if $name;
}
Expand Down