From: Marius Gavrilescu Date: Fri, 20 Feb 2015 12:08:18 +0000 (+0200) Subject: Return a 404 for robots.txt and favicon.ico X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=3ef3217494bfccc63dbb6b0a163b1e4d1f4ec400;p=gruntmaster-page.git Return a 404 for robots.txt and favicon.ico --- diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 2edc6dc..edf1911 100644 --- a/lib/Plack/App/Gruntmaster.pm +++ b/lib/Plack/App/Gruntmaster.pm @@ -53,7 +53,7 @@ use constant FORMAT_EXTENSION => { SBCL => 'l', }; -use constant NOT_FOUND => [404, ['Content-Type' => 'text/plain'], ['Not found']]; +use constant NOT_FOUND => [404, ['X-Forever' => 1, 'Content-Type' => 'text/plain'], ['Not found']]; use constant FORBIDDEN => [401, ['Content-Type' => 'text/plain', 'WWW-Authenticate' => 'Basic realm="Gruntmaster 6000"'], ['Forbidden']]; sub development() { ($ENV{PLACK_ENV} // 'development') eq 'development' } @@ -115,6 +115,9 @@ sub dispatch_request{ [200, \@headers, [development ? $js : JavaScript::Minifier::XS::minify $js]] }, + sub (/robots.txt) { NOT_FOUND }, + sub (/favicon.ico) { NOT_FOUND }, + sub (/src/:job) { return NOT_FOUND if !job; my $isowner = remote_user && remote_user->id eq job->rawowner;