diff options
author | Eric Wong <e@80x24.org> | 2015-08-30 10:12:54 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-30 10:12:54 +0000 |
commit | 7c9ece10460f53e37f457e85d6d71eaa0c3c86ee (patch) | |
tree | ef8bde3a8ac178bd0874affbd75955bdef8902d3 | |
parent | ab8bdfe79cd0b6cac57b4f1cae538c51e8f9c317 (diff) | |
download | public-inbox-7c9ece10460f53e37f457e85d6d71eaa0c3c86ee.tar.gz |
It fails the syntax check if a user does not have ~/.public-inbox/config setup. Anyways we can safely use ||= on a global since we do not support threads.
-rw-r--r-- | lib/PublicInbox/WWW.pm | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm index a01271b1..e6eec3d6 100644 --- a/lib/PublicInbox/WWW.pm +++ b/lib/PublicInbox/WWW.pm @@ -17,12 +17,10 @@ use constant SSOMA_URL => 'http://ssoma.public-inbox.org/'; use constant PI_URL => 'http://public-inbox.org/'; our $LISTNAME_RE = qr!\A/([\w\.\-]+)!; our $pi_config; -BEGIN { - $pi_config = PublicInbox::Config->new; -} sub run { my ($cgi, $method) = @_; + $pi_config ||= PublicInbox::Config->new; my %ctx = (cgi => $cgi, pi_config => $pi_config); if ($method !~ /\AGET|HEAD\z/) { return r(405, 'Method Not Allowed'); |