Permalink
Browse files

enable ContentLength and Chunked by default

  • Loading branch information...
1 parent bd16c41 commit 7f08f7693d4869ed2cb6ce40003c0c45859a7c78 @miyagawa committed Oct 29, 2009
Showing with 4 additions and 5 deletions.
  1. +4 −5 lib/Plack/Server/AnyEvent.pm
@@ -23,6 +23,7 @@ use Plack::HTTPParser qw(parse_http_request);
use Plack::Util;
use Plack::Middleware::ContentLength;
+use Plack::Middleware::Chunked;
use constant HAS_AIO => !$ENV{PLACK_NO_SENDFILE} && try {
require AnyEvent::AIO;
@@ -38,7 +39,6 @@ sub new {
return bless {
host => undef,
port => undef,
- content_length_middleware => 1,
no_delay => 1,
@args,
}, $class;
@@ -47,11 +47,10 @@ sub new {
sub register_service {
my($self, $app) = @_;
- my $wrapped = $self->{content_length_middleware}
- ? Plack::Middleware::ContentLength->wrap($app)
- : $app;
+ $app = Plack::Middleware::ContentLength->wrap($app);
+ $app = Plack::Middleware::Chunked->wrap($app);
- $self->{listen_guard} = $self->_create_tcp_server($wrapped);
+ $self->{listen_guard} = $self->_create_tcp_server($app);
}
sub _create_tcp_server {

0 comments on commit 7f08f76

Please sign in to comment.