From be6551aa39afa16aeea55d8073d6c4039aaf7f5d Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Fri, 6 Feb 2015 14:08:41 +0200 Subject: [PATCH] Vary on authorization for private responses --- lib/Plack/App/Gruntmaster.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 77a8828..1a0c7ab 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -137,6 +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]] -- 2.39.2