]> iEval git - gruntmaster-page.git/blobdiff - app.psgi
Merge branch 'master' into newmc
[gruntmaster-page.git] / app.psgi
index 597e94167d5eebc968ea5e80ce6f66dd0937fe99..837dd60ab51e100408d84934eb6d7fd80a4a724c 100644 (file)
--- a/app.psgi
+++ b/app.psgi
@@ -16,8 +16,8 @@ form-action 'self'
 frame-ancestors 'none'
 img-src 'self' https://static.mindcoding.ro
 referrer origin-when-cross-origin
-script-src https://static.mindcoding.ro/static/js.js
-style-src https://static.mindcoding.ro/static/css/
+script-src 'self'
+style-src 'self'
 CSP
        chomp $csp;
        $csp =~ s/\n/; /gr;
@@ -41,7 +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', '<https://static.mindcoding.ro/static/slate.css>; rel=stylesheet') if $hdrs->get('Content-Type') =~ m,^text/html,;
+               $hdrs->set('Cache-Control', 'public, max-age=604800') if $_[0]->{PATH_INFO} =~ qr,^/static/,;
                $resp->[1] = $hdrs->headers;
                $resp;
        }
@@ -54,6 +54,7 @@ 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',
This page took 0.023986 seconds and 4 git commands to generate.