Skip Menu |

This queue is for tickets about the AnyEvent-FCGI CPAN distribution.

Report information
The Basics
Id: 61566
Status: open
Priority: 0/
Queue: AnyEvent-FCGI

People
Owner: Nobody in particular
Requestors: bruce.saunders [...] recursivedesigns.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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";

Version 0.03 of AnyEvent::FCGI supports multiple headers with a same name because "respond" method accepts headers as an array (not hash), so you can use it like this: $request->respond('content', 'Set-Cookie' => 'name1=value1', 'Set-Cookie' => 'name2=value2');
Subject: Re: [rt.cpan.org #61566] AnyEvent::FCGI::Request::respond doesn't support multiple Set-Cookie headers
Date: Fri, 24 Sep 2010 10:35:42 -0400
To: "bug-AnyEvent-FCGI [...] rt.cpan.org" <bug-AnyEvent-FCGI [...] rt.cpan.org>
From: Bruce Saunders <bruce.saunders [...] recursivedesigns.org>
Ah, yes. Sorry 'bout that. I should have checked more carefully before submitting the bug. Thanks for contributing a great module, by the way. Bruce On Sep 23, 2010, at 4:44 AM, "Vitaly Kramskikh via RT" <bug-AnyEvent-FCGI@rt.cpan.org Show quoted text
> wrote:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=61566 > > > Version 0.03 of AnyEvent::FCGI supports multiple headers with a same > name because "respond" method accepts headers as an array (not > hash), so > you can use it like this: > > $request->respond('content', 'Set-Cookie' => 'name1=value1', > 'Set-Cookie' => 'name2=value2'); >