]> iEval git - plack-app-gruntmaster.git/blobdiff - lib/Plack/App/Gruntmaster.pm
Remove login dependency on cookies & referer
[plack-app-gruntmaster.git] / lib / Plack / App / Gruntmaster.pm
index f32c606866244604e080ca7bfae792a4b4420d71..7a3dc348b065037ae139a111b2494945a85eb747 100644 (file)
@@ -34,6 +34,7 @@ use constant CONTENT_TYPES => +{
        pas => 'text/x-pascal',
        pl => 'text/x-perl',
        py => 'text/x-python',
+       rb => 'application/x-ruby',
        l => 'text/plain',
 };
 
@@ -48,6 +49,7 @@ use constant FORMAT_EXTENSION => {
        PASCAL => 'pas',
        PERL => 'pl',
        PYTHON => 'py',
+       RUBY => 'rb',
        SBCL => 'l',
 };
 
@@ -138,9 +140,7 @@ sub dispatch_request{
 
                sub (/login) {
                        forbid !remote_user;
-
-                       my $return = $env->{HTTP_REFERER} // '/';
-                       [303, ['Set-Cookie' => "username=".remote_user->id, Location => $return], []]
+                       [200, ['Content-Type' => 'text/plain; charset=UTF-8', 'Cache-Control' => 'private, max-age=300', Vary => 'Authorization'], [$env->{REMOTE_USER}]]
                },
 
                sub (/ct/:contest/log/st) { redirect "/st/$_{contest}" },
This page took 0.020927 seconds and 4 git commands to generate.