about summary refs log tree commit homepage
path: root/script/public-inbox-httpd
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-05 20:53:25 +0000
committerEric Wong <e@80x24.org>2016-03-05 20:53:25 +0000
commite876cd472939c009a0d6bce3cee25d98b0940928 (patch)
tree5d31e56e2d8f36a8f90d05bcd5d9f09d785f8782 /script/public-inbox-httpd
parent288f29a022b6b72ec460cf5bf34a183f1b54cc4c (diff)
downloadpublic-inbox-e876cd472939c009a0d6bce3cee25d98b0940928.tar.gz
We have per-middleware evals to deal with them being missing;
no need to put an eval around the whole thing and use an
extra level of indentation.
Diffstat (limited to 'script/public-inbox-httpd')
-rwxr-xr-xscript/public-inbox-httpd32
1 files changed, 15 insertions, 17 deletions
diff --git a/script/public-inbox-httpd b/script/public-inbox-httpd
index b6c4e677..e7ed3c9d 100755
--- a/script/public-inbox-httpd
+++ b/script/public-inbox-httpd
@@ -23,28 +23,26 @@ my $refresh = sub {
                 require PublicInbox::WWW;
                 PublicInbox::WWW->preload;
                 my $www = PublicInbox::WWW->new;
-                $app = eval {
-                        builder {
-                                enable 'Chunked';
-                                eval {
-                                        enable 'Deflater',
-                                                content_type => [ qw(
-                                                        text/html
-                                                        text/plain
-                                                        application/atom+xml
-                                                        )]
-                                };
-                                $@ and warn
+                $app = builder {
+                        enable 'Chunked';
+                        eval {
+                                enable 'Deflater',
+                                        content_type => [ qw(
+                                                text/html
+                                                text/plain
+                                                application/atom+xml
+                                                )]
+                        };
+                        $@ and warn
 "Plack::Middleware::Deflater missing, bandwidth will be wasted\n";
 
-                                eval { enable 'ReverseProxy' };
-                                $@ and warn
+                        eval { enable 'ReverseProxy' };
+                        $@ and warn
 "Plack::Middleware::ReverseProxy missing,\n",
 "URL generation for redirects may be wrong if behind a reverse proxy\n";
 
-                                enable 'Head';
-                                sub { $www->call(@_) };
-                        };
+                        enable 'Head';
+                        sub { $www->call(@_) };
                 };
         }
 };