From 218d6f7ee80aa3dbb3781bdd9b55350a7b27faa6 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Mon, 20 Apr 2015 17:27:39 +0300 Subject: [PATCH 1/1] Use Content-Type: text/plain for all sources --- lib/Plack/App/Gruntmaster.pm | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) 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]] }, -- 2.39.2