]> iEval git - plack-app-gruntmaster.git/commitdiff
Use a Link: header with the default stylesheet
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 22 Mar 2015 19:51:46 +0000 (21:51 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 22 Mar 2015 19:51:46 +0000 (21:51 +0200)
app.psgi

index 53721091fb1bf799c058206d811e4bfc12eaf186..f7c85ffec3149dbd1bba33486039966bb74dfd92 100644 (file)
--- a/app.psgi
+++ b/app.psgi
@@ -44,6 +44,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', '</static/cyborg.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;
This page took 0.027709 seconds and 4 git commands to generate.