X-Git-Url: http://git.ieval.ro/?p=plack-app-gruntmaster.git;a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=2ccbeb50d8e216211e656d9b0046a0e469ee5d84;hp=c02e7dd3f023cbdbd84c402f36cc0d85cabbcd06;hb=218d6f7ee80aa3dbb3781bdd9b55350a7b27faa6;hpb=77a593ad89d90a42d70510d637d88d25ada625df diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index c02e7dd..2ccbeb5 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -21,21 +21,6 @@ no warnings 'illegalproto'; use constant USER_REGEX => qr/^\w{2,20}$/a; -use constant CONTENT_TYPES => +{ - c => 'text/x-csrc', - cpp => 'text/x-c++src', - cs => 'text/x-csharp', # Used by GNOME. Not in mime.types. - go => 'text/plain', # ? - gs => 'text/plain', - hs => 'text/x-haskell', - java => 'text/x-java', - pas => 'text/x-pascal', - pl => 'text/x-perl', - py => 'text/x-python', - rb => 'application/x-ruby', - l => 'text/plain', -}; - use constant FORMAT_EXTENSION => { C => 'c', CPP => 'cpp', @@ -103,7 +88,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->extension}); + my @headers = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=604800", 'Content-Type' => 'text/plain'); push @headers, (Vary => 'Authorization') if $private; [200, \@headers, [job->source]] },