Skip to content

Commit 448560f

Browse files
authored
Merge pull request #21 from daniel-95/hash-req
multiple cookies support, should be passed as array ref
2 parents 4a4973e + 0b4e33b commit 448560f

File tree

1 file changed

+9
-0
lines changed
  • lib/AnyEvent/HTTP/Server

1 file changed

+9
-0
lines changed

lib/AnyEvent/HTTP/Server/Req.pm

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,15 @@ BEGIN {
354354
$h->{'content-type'} = 'text/html; charset=utf-8';
355355
}
356356
my $nh = delete $h->{NotHandled};
357+
358+
# set multiple cookies
359+
if(ref $h->{'set-cookie'} eq 'ARRAY') {
360+
my $cookies = delete $h->{'set-cookie'};
361+
362+
#set-cookie is not in @hdr
363+
push(@bad, "Set-Cookie: ".$_.$LF) for(@{$cookies});
364+
}
365+
357366
for (keys %$h) {
358367
if (exists $hdr{lc $_}) { $good[ $hdri{lc $_} ] = $hdr{ lc $_ }.": ".$h->{$_}.$LF; }
359368
else {

0 commit comments

Comments
 (0)