Skip to content

Commit

Permalink
Merge pull request #567 from metacpan/leo/do_not_cache_errors
Browse files Browse the repository at this point in the history
Leo/do not cache errors
  • Loading branch information
ranguard committed Nov 19, 2016
2 parents f0eecd1 + 17e0dd1 commit 72a0944
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cpanfile
Expand Up @@ -87,7 +87,7 @@ requires 'Log::Contextual';
requires 'Log::Log4perl';
requires 'Log::Log4perl::Appender::ScreenColoredLevels';
requires 'MetaCPAN::Moose';
requires 'MetaCPAN::Role', '0.05';
requires 'MetaCPAN::Role', '0.06';
requires 'Minion', '>= 5.07';
requires 'Minion::Backend::SQLite';
requires 'Module::Load';
Expand Down
10 changes: 5 additions & 5 deletions cpanfile.snapshot
Expand Up @@ -4201,12 +4201,12 @@ DISTRIBUTIONS
perl 5.006
strict 0
warnings 0
MetaCPAN-Role-0.05
pathname: L/LL/LLAP/MetaCPAN-Role-0.05.tar.gz
MetaCPAN-Role-0.06
pathname: L/LL/LLAP/MetaCPAN-Role-0.06.tar.gz
provides:
MetaCPAN::Role 0.05
MetaCPAN::Role::Fastly 0.05
MetaCPAN::Role::Fastly::Catalyst 0.05
MetaCPAN::Role 0.06
MetaCPAN::Role::Fastly 0.06
MetaCPAN::Role::Fastly::Catalyst 0.06
requirements:
Carp 0
CatalystX::Fastly::Role::Response 0.04
Expand Down
4 changes: 4 additions & 0 deletions lib/MetaCPAN/Server/Controller.pm
Expand Up @@ -205,12 +205,16 @@ sub join : ActionClass('Deserialize') {

sub not_found : Private {
my ( $self, $c ) = @_;
$c->cdn_never_cache(1);

$c->res->code(404);
$c->stash( { message => 'Not found' } );
}

sub internal_error {
my ( $self, $c, $message ) = @_;
$c->cdn_never_cache(1);

$c->res->code(500);
if ( eval { $message->isa('ElasticSearch::Error') } ) {
$c->res->content_type('text/plain');
Expand Down

0 comments on commit 72a0944

Please sign in to comment.