diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/public-inbox.psgi | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/public-inbox.psgi b/examples/public-inbox.psgi index 1de5bb7d..b0b9ae98 100644 --- a/examples/public-inbox.psgi +++ b/examples/public-inbox.psgi @@ -9,10 +9,14 @@ 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' ]; + if ($have_deflater) { + enable "Deflater", + content_type => [ 'text/html', 'text/plain', + 'application/atom+xml' ]; + } enable "Head"; sub { my $req = Plack::Request->new(@_); |