Skip to content

Commit 0b4e33b

Browse files
author
Daniil Shelepanov
committed
multiple cookies support, should be passed as array ref
1 parent 7d75105 commit 0b4e33b

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
@@ -346,6 +346,15 @@ use Digest::SHA1 'sha1';
346346
$h->{'content-type'} = 'text/html; charset=utf-8';
347347
}
348348
my $nh = delete $h->{NotHandled};
349+
350+
# set multiple cookies
351+
if(ref $h->{'set-cookie'} eq 'ARRAY') {
352+
my $cookies = delete $h->{'set-cookie'};
353+
354+
#set-cookie is not in @hdr
355+
push(@bad, "Set-Cookie: ".$_.$LF) for(@{$cookies});
356+
}
357+
349358
for (keys %$h) {
350359
if (exists $hdr{lc $_}) { $good[ $hdri{lc $_} ] = $hdr{ lc $_ }.": ".$h->{$_}.$LF; }
351360
else {

0 commit comments

Comments
 (0)