X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FPlack%2FApp%2FGruntmaster.pm;h=288f18c95d8b6ddce1c63afebbfdb0067781b231;hb=c99c1530347a64a134c74659f10b9c1cd632b42f;hp=0cb7aabca2fa1b0dd392b33ea74b9f0b29d61900;hpb=8ee0846af473b6b58ad0641406b56b255ca26366;p=plack-app-gruntmaster.git diff --git a/lib/Plack/App/Gruntmaster.pm b/lib/Plack/App/Gruntmaster.pm index 0cb7aab..288f18c 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; @@ -279,6 +282,8 @@ website using the following information: Username: $_{username} Password: Reset token: $token + +The token is valid for 24 hours. EOF my $email = Email::Simple->create( header => [ @@ -302,6 +307,7 @@ EOF my $user = db->user($_{username}); return reply 'No such user' unless $user; my ($token, $exp) = split ':', $_{token}; + return reply 'Reset token is expired' if time >= $exp; return reply 'Bad reset token' unless $user->make_reset_hmac($exp) eq $token; $user->set_passphrase($_{password}); reply 'Password reset successfully';