Permalink
Browse files

Fix multi headers handling

  • Loading branch information...
1 parent 294fb85 commit 3278802815048cff42b01ca2b929bc1db07041d4 Jonathan Steinert committed Feb 27, 2010
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Perlbal/Plugin/PSGI.pm
View
8 lib/Perlbal/Plugin/PSGI.pm
@@ -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);

0 comments on commit 3278802

Please sign in to comment.