X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=app.psgi;h=597e94167d5eebc968ea5e80ce6f66dd0937fe99;hb=bffec365a2e7fa722c8a5ed515acdc3c07a3a4aa;hp=8fbc2c01337e9f910105510c77bea4fc6b95bdad;hpb=727d13d26f97e481c1d7bb47f939e4b06ff8ad96;p=plack-app-gruntmaster.git diff --git a/app.psgi b/app.psgi index 8fbc2c0..597e941 100644 --- a/app.psgi +++ b/app.psgi @@ -14,10 +14,10 @@ default-src 'none' connect-src 'self' form-action 'self' frame-ancestors 'none' -img-src 'self' +img-src 'self' https://static.mindcoding.ro referrer origin-when-cross-origin -script-src 'self' -style-src 'self' +script-src https://static.mindcoding.ro/static/js.js +style-src https://static.mindcoding.ro/static/css/ CSP chomp $csp; $csp =~ s/\n/; /gr; @@ -41,8 +41,7 @@ sub add_headers { my $resp = $app->($_[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; } @@ -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',