From: Marius Gavrilescu Date: Fri, 6 Feb 2015 12:09:01 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;ds=sidebyside;h=29de778ba60e4c2b499b417e0dfa4317d54c5d57;hp=-c;p=gruntmaster-page.git Merge branch 'master' into newmc --- 29de778ba60e4c2b499b417e0dfa4317d54c5d57 diff --combined lib/Plack/App/Gruntmaster.pm index 45cdfd1,1a0c7ab..f091892 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@@ -137,6 -137,7 +137,7 @@@ sub dispatch_request my ($r) = @_; return $r if ref $r ne 'Plack::App::Gruntmaster::Response'; my @hdrs = ('X-Forever' => 1, 'Cache-Control' => "$privacy, max-age=$r->{maxage}"); + push @hdrs, Vary => 'Authorization' if $privacy eq 'private'; return [200, ['Content-Type' => 'application/json', @hdrs], [encode_json $r->{params}]] if $format eq 'json'; my $ret = render $r->{template}, 'en', title => $r->{title}, %{$r->{params}}; [200, ['Content-Type' => 'text/html', @hdrs], [encode 'UTF-8', $ret]] @@@ -239,10 -240,9 +240,10 @@@ my $source = $prog ? read_file $prog->path : $_{source_code}; unlink $prog->path if $prog; + my $private = (problem->private && !$_{contest}) ? 1 : 0; my $newjob = db->jobs->create({ maybe contest => $_{contest}, - maybe private => problem->private && !$_{contest}, + private => $private, date => time, extension => FORMAT_EXTENSION->{$_{prog_format}}, format => $_{prog_format},