X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=examples%2Fpublic-inbox.psgi;h=9fa51ba6b3583e27d3ab4c5ee5d48c6dad78868d;hb=48dbde1b098d836660d3eefbacbd57e487b3eaed;hp=1de5bb7daec73120aa1502905dd2559b2c6cbb26;hpb=f76f265a851944b5dedcc3be5f3b5224b6ebda89;p=public-inbox.git diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 1de5bb7d..9fa51ba6 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -9,11 +9,16 @@ use PublicInbox::WWW; PublicInbox::WWW->preload; use Plack::Request; use Plack::Builder; +my $have_deflater = eval { require Plack::Middleware::Deflater; 1 }; + builder { - enable "Deflater", - content_type => [ 'text/html', 'text/plain', - 'application/atom+xml' ]; - enable "Head"; + enable 'Chunked'; + if ($have_deflater) { + enable 'Deflater', + content_type => [ 'text/html', 'text/plain', + 'application/atom+xml' ]; + } + enable 'Head'; sub { my $req = Plack::Request->new(@_); PublicInbox::WWW::run($req, $req->method);