Browse files

Noted the Server limitation due to AE::HTTP API.

Fixed a bug in multiple response headers.
  • Loading branch information...
1 parent b5dfc6b commit 9aca0304a97c0708f31187951d091444496731bf @miyagawa committed Feb 5, 2010
Showing with 15 additions and 1 deletion.
  1. +15 −1 lib/Plack/Handler/AnyEvent/HTTPD.pm
View
16 lib/Plack/Handler/AnyEvent/HTTPD.pm
@@ -114,7 +114,11 @@ sub handle_psgi_request {
my $respond = sub {
my $res = shift;
- my @res = ($res->[0], HTTP::Status::status_message($res->[0]), {@{$res->[1]}});
+ my %headers;
+ while ( my($key, $val) = splice @{$res->[1]}, 0, 2) {
+ $headers{$key} = exists $headers{$key} ? "$headers{$key}, $val" : $val;
+ }
+ my @res = ($res->[0], HTTP::Status::status_message($res->[0]), \%headers);
if (defined $res->[2]) {
my $content;
@@ -190,6 +194,16 @@ Plack::Handler::AnyEvent::HTTPD - Plack handler to run PSGI apps on AnyEvent::HT
Plack::Handler::AnyEvent::HTTPD is a Plack handler to run PSGI apps on AnyEvent::HTTPD module.
+=head1 LIMITATIONS
+
+=over 4
+
+=item *
+
+C<< $env->{SERVER_PROTOCOL} >> is always I<HTTP/1.0> regardless of the request version.
+
+=back
+
=head1 AUTHOR
Tatsuhiko Miyagawa E<lt>miyagawa@bulknews.netE<gt>

0 comments on commit 9aca030

Please sign in to comment.