* [PATCH] httpd: remove unnecessary eval
@ 2016-03-05 21:02 7% Eric Wong
0 siblings, 0 replies; 1+ results
From: Eric Wong @ 2016-03-05 21:02 UTC (permalink / raw)
To: meta
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 | 32 +++++++++++++++-----------------
1 file changed, 15 insertions(+), 17 deletions(-)
diff --git a/script/public-inbox-httpd b/script/public-inbox-httpd
index b6c4e67..e7ed3c9 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(@_) };
};
}
};
--
EW
^ permalink raw reply related [relevance 7%]
Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-03-05 21:02 7% [PATCH] httpd: remove unnecessary eval Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).