]> Sergey Matveev's repositories - public-inbox.git/commitdiff
httpd: remove unnecessary eval
authorEric Wong <e@80x24.org>
Sat, 5 Mar 2016 20:53:25 +0000 (20:53 +0000)
committerEric Wong <e@80x24.org>
Sat, 5 Mar 2016 20:53:25 +0000 (20:53 +0000)
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.

script/public-inbox-httpd

index b6c4e6777c3fb73a1393a1a228676d5331d00a93..e7ed3c9df4fa1e122dd1714cea5678e9d2e56ab6 100755 (executable)
@@ -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(@_) };
                };
        }
 };