]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster.pm
Do not return 404 for favicon.ico
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster.pm
index 3ec528429124eb4e1c0b85bd1174b29252c91554..3a7b9db121302ed83d9dcba510193693050324cb 100644 (file)
@@ -116,7 +116,6 @@ sub dispatch_request{
                },
 
                sub (/robots.txt) { NOT_FOUND },
-               sub (/favicon.ico) { NOT_FOUND },
 
                sub (/src/:job) {
                        return NOT_FOUND if !job;
@@ -124,7 +123,7 @@ sub dispatch_request{
                        my $private = job->private || job->problem->private || job->contest && job->contest->is_running;
                        forbid !$isowner && $private;
                        my $privacy = $private ? 'private' : 'public';
-                       my @headers = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=604800", 'Content-Type' => CONTENT_TYPES->{job->format});
+                       my @headers = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=604800", 'Content-Type' => CONTENT_TYPES->{job->extension});
                        push @headers, (Vary => 'Authorization') if $private;
                        [200, \@headers, [job->source]]
                },
@@ -165,8 +164,9 @@ sub dispatch_request{
                },
 
                sub (/ed/:contest) {
-                       forbid contest->is_running;
-                       response ed => 'Editorial of ' . contest->name, db->problem_list(contest => $_{contest}, solution => 1);
+                       forbid !contest->is_finished;
+                       my $pblist = db->problem_list(contest => $_{contest}, solution => 1);
+                       response ed => 'Editorial of ' . contest->name, {%$pblist, editorial => contest->editorial};
                },
 
                sub (/login) {
@@ -226,7 +226,6 @@ sub dispatch_request{
                        db->users->create({id => $_{username}, name => $_{name}, email => $_{email}, phone => $_{phone}, town => $_{town}, university => $_{university}, country => $_{country}, level => $_{level}});
                        db->user($_{username})->set_passphrase($_{password});
 
-                       purge '/us/';
                        reply 'Registered successfully';
                },
 
@@ -263,7 +262,6 @@ sub dispatch_request{
                                owner => remote_user->id,
                        });
 
-                       purge '/log/';
                        [303, [Location => '/log/' . $newjob->id], []]
                },
 
This page took 0.026387 seconds and 4 git commands to generate.