X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=script%2Fpublic-inbox.cgi;h=42ab17c9e34b8e10fb24a0410ec25a9b620a3d09;hb=4f1a683dc895a7bd4cf79e58b39faea256045921;hp=5b2aefe2311b1ab5e5e21e49bb60ade4a41fc5d6;hpb=c3509baca0b103a0c9d034de06f3ddc5fc9426fd;p=public-inbox.git
diff --git a/script/public-inbox.cgi b/script/public-inbox.cgi
index 5b2aefe2..42ab17c9 100755
--- a/script/public-inbox.cgi
+++ b/script/public-inbox.cgi
@@ -1,26 +1,22 @@
#!/usr/bin/perl -w
-# Copyright (C) 2014-2016 all contributors
+# Copyright (C) 2014-2020 all contributors
# License: AGPL-3.0+ or later
#
# Enables using PublicInbox::WWW as a CGI script
use strict;
-use warnings;
-use Plack::Builder;
-use Plack::Handler::CGI;
-use PublicInbox::WWW;
-BEGIN { PublicInbox::WWW->preload if $ENV{MOD_PERL} }
+BEGIN {
+ for (qw(Plack::Builder Plack::Handler::CGI)) {
+ eval("require $_") or die "E: Plack is required for $0\n";
+ }
+ Plack::Builder->import;
+ require PublicInbox::WWW;
+ PublicInbox::WWW->preload if $ENV{MOD_PERL};
+}
my $www = PublicInbox::WWW->new;
-my $have_deflater = eval { require Plack::Middleware::Deflater; 1 };
my $app = builder {
- if ($have_deflater) {
- enable 'Deflater',
- content_type => [ 'text/html', 'text/plain',
- 'application/atom+xml' ];
- }
-
# Enable to ensure redirects and Atom feed URLs are generated
# properly when running behind a reverse proxy server which
- # sets X-Forwarded-For and X-Forwarded-Proto request headers.
+ # sets the X-Forwarded-Proto request header.
# See Plack::Middleware::ReverseProxy documentation for details
# enable 'ReverseProxy';