From: Marius Gavrilescu Date: Sat, 28 Mar 2015 14:07:28 +0000 (+0200) Subject: Merge branch 'master' into newmc X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=bffec365a2e7fa722c8a5ed515acdc3c07a3a4aa;hp=-c;p=plack-app-gruntmaster.git Merge branch 'master' into newmc --- bffec365a2e7fa722c8a5ed515acdc3c07a3a4aa diff --combined app.psgi index 323748d,8fbc2c0..597e941 --- a/app.psgi +++ b/app.psgi @@@ -1,6 -1,6 +1,6 @@@ - #!/usr/bin/perl -w + #!/usr/bin/perl use v5.14; - no if $] >= 5.017011, warnings => 'experimental::smartmatch'; + use warnings; use Gruntmaster::Data; use Plack::App::Gruntmaster; @@@ -8,18 -8,16 +8,16 @@@ use Plack::Builder use Plack::Util; use Log::Log4perl; - use constant AUTH_TIMEOUT => 5 * 60; - sub CONTENT_SECURITY_POLICY () { my $csp = <($_[0]); my $hdrs = Plack::Util::headers($resp->[1]); $hdrs->set('Content-Security-Policy', CONTENT_SECURITY_POLICY); - $hdrs->set('Link', '; rel=stylesheet') if $hdrs->get('Content-Type') =~ m,^text/html,; - $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO} =~ qr,^/static/,; + $hdrs->set('Link', '; rel=stylesheet') if $hdrs->get('Content-Type') =~ m,^text/html,; $resp->[1] = $hdrs->headers; $resp; } @@@ -56,6 -55,7 +54,6 @@@ builder enable_if { $_[0]->{PATH_INFO} eq '/ok' } sub { sub{ [200, [], []] }}; enable 'ContentLength'; enable \&add_headers; - enable 'Static', path => qr,^/static/,; enable 'Log4perl', category => 'plack'; enable \&add_database; enable '+Plack::App::Gruntmaster::Auth',