Subject: | AnyEvent::FCGI::Request::respond doesn't support multiple Set-Cookie headers |
Date: | Wed, 22 Sep 2010 06:22:49 -0700 |
To: | bug-AnyEvent-FCGI [...] rt.cpan.org |
From: | <bruce.saunders [...] recursivedesigns.org> |
Included is the diff for a possible patch against version 0.03 of AnyEvent::FCGI.
I've added support for duplicate headers when the value for a header is an array. This allows me to pass in an array of cookies and will output multiple Set-Cookie: statements in the header section.
290,302c290
< my $value = shift(@headers);
<
< # MODIFIED 9/22/2010 - Bruce Saunders
< # added support for array references as values
< # this allows multiple Set-Cookie headers (and perhaps other things)
< if ( ref $value eq 'ARRAY' ) {
< foreach my $v (@$value) {
< $output .= $header . ': ' . $v . "\n";
< }
<
< } else {
< $output .= $header . ': ' . $value . "\n";
< }
---
> $output .= $header . ': ' . shift(@headers) . "\n";
< my $value = shift(@headers);
<
< # MODIFIED 9/22/2010 - Bruce Saunders
< # added support for array references as values
< # this allows multiple Set-Cookie headers (and perhaps other things)
< if ( ref $value eq 'ARRAY' ) {
< foreach my $v (@$value) {
< $output .= $header . ': ' . $v . "\n";
< }
<
< } else {
< $output .= $header . ': ' . $value . "\n";
< }
---
> $output .= $header . ': ' . shift(@headers) . "\n";