From 5a2112d32984d8621a6fb8a461b85ddf9c37e9ba Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Wed, 5 Feb 2014 11:54:29 +0200 Subject: [PATCH] Return 404 when the requested theme is not found --- lib/Gruntmaster/Page/CSS.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Gruntmaster/Page/CSS.pm b/lib/Gruntmaster/Page/CSS.pm index 0f4bf6a..a6f647a 100644 --- a/lib/Gruntmaster/Page/CSS.pm +++ b/lib/Gruntmaster/Page/CSS.pm @@ -13,6 +13,7 @@ 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 ; [200, ['Content-Type' => 'text/css', 'Cache-Control' => 'public, max-age=604800'], [minify $css] ] -- 2.39.2