]> iEval git - plack-app-gruntmaster.git/blobdiff - app.psgi
Merge branch 'master' into mindcoding
[plack-app-gruntmaster.git] / app.psgi
index 9908172efb807320b8562f03bc201b43a6048c40..c470f30dd8abbe714c5887210f44e1d6c635371f 100644 (file)
--- a/app.psgi
+++ b/app.psgi
@@ -11,7 +11,7 @@ use Digest::SHA qw/sha256/;
 use Log::Log4perl;
 
 use constant ACCESSLOG_FORMAT => '%{X-Forwarded-For}i|%h %u "%r" %>s %b "%{Referer}i" "%{User-agent}i"';
-use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' www.google-analytics.com; style-src 'self'; img-src 'self'; connect-src 'self',;
+use constant CONTENT_SECURITY_POLICY => q,default-src 'none'; script-src 'self' www.google-analytics.com; style-src 'self'; img-src 'self' www.google-analytics.com; connect-src 'self',;
 
 $Apache2::AuthzCaps::rootdir = $Apache2::Authen::Passphrase::rootdir;
 my $word = qr,(\w+),a;
@@ -24,6 +24,7 @@ sub debug {
 sub some_auth_required {
        my $r = Plack::Request->new($_[0]);
        return 1 if $_[0]->{'gruntmaster.reqadmin'} || $r->path eq '/action/passwd' || $r->path =~ m,/pb/$word/submit$,;
+       return 1 if $r->path =~ m,^/ct/$word/pb/$word, && time < contest_end $1;
        0
 }
 
@@ -39,7 +40,7 @@ sub admin_required {
 sub require_admin {
        my $app = $_[0];
        sub {
-               *__ANON__ = "require_admin_middleware";
+               local *__ANON__ = "require_admin_middleware";
                my $env = $_[0];
                my $r = Plack::Request->new($env);
                $env->{'gruntmaster.reqadmin'} = 1 if admin_required $r->path;
This page took 0.01997 seconds and 4 git commands to generate.