]> Sergey Matveev's repositories - public-inbox.git/blobdiff - public-inbox.cgi
examples/public-inbox.psgi: update with middlewares
[public-inbox.git] / public-inbox.cgi
index 63663f32c4972cf040cbdfe890d7bf2841d4cda3..b095621da3c9c1f7d583959a05f049341b3c6b22 100755 (executable)
@@ -4,17 +4,22 @@
 use strict;
 use warnings;
 use IO::Handle;
-require PublicInbox::WWW;
+use PublicInbox::WWW;
 use CGI qw/-nosticky/;
 our $NO_SCRIPT_NAME;
 our %HTTP_CODES;
 BEGIN {
        $NO_SCRIPT_NAME = 1 if $ENV{NO_SCRIPT_NAME};
-       CGI->compile if $ENV{MOD_PERL};
+       if ($ENV{MOD_PERL}) {
+               CGI->compile;
+               PublicInbox::WWW->preload;
+       }
 
        %HTTP_CODES = (
                200 => 'OK',
+               300 => 'Multiple Choices',
                301 => 'Moved Permanently',
+               302 => 'Found',
                404 => 'Not Found',
                405 => 'Method Not Allowed',
                501 => 'Not Implemented',