Skip to content

Commit

Permalink
Fix multi headers handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Steinert committed Feb 28, 2010
1 parent 294fb85 commit 3278802
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/Perlbal/Plugin/PSGI.pm
Expand Up @@ -166,8 +166,14 @@ sub run_request {
my $res = shift;

my $hd = $pb->{res_headers} = Perlbal::HTTPHeaders->new_response($res->[0]);
my %seen;
while (my($k, $v) = splice @{$res->[1]}, 0, 2) {
$hd->header($k, $v);
if ($seen{lc($k)}++) {
my $newvalue = $hd->header($k) . "\015\012$k: $v";
$hd->header($k, $newvalue);
} else {
$hd->header($k, $v);
}
}

$pb->setup_keepalive($hd);
Expand Down

0 comments on commit 3278802

Please sign in to comment.