]> iEval git - gruntmaster-page.git/blobdiff - lib/Gruntmaster/Page/CSS.pm
Return 404 when the requested theme is not found
[gruntmaster-page.git] / lib / Gruntmaster / Page / CSS.pm
index a3e227fb7b536eb52f5000338d39d35a65104749..a6f647a5f924846cbabb0607893158c67acc2644 100644 (file)
@@ -13,9 +13,10 @@ use CSS::Minifier::XS qw/minify/;
 sub generate{
        my ($self, $format, $logger, $theme) = @_;
        debug $logger => "theme is $theme";
+       return [404, ['Content-Type' => 'text/plain'], [ 'Not found' ]] unless -e "css/themes/$theme.css";
        my $css = read_file "css/themes/$theme.css";
        $css .= read_file $_ for <css/*.css>;
-       [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'max-age=604800'], [minify $css] ]
+       [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800'], [minify $css] ]
 }
 
 sub variants{ [[css => 1, 'text/css', undef, undef, undef, undef]] }
This page took 0.018216 seconds and 4 git commands to generate.