Skip to content

Commit

Permalink
Temporarily comment out some stash interactions.
Browse files Browse the repository at this point in the history
  • Loading branch information
oalders committed Nov 11, 2015
1 parent aab1b75 commit 9b8fb0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions app.psgi
Expand Up @@ -3,6 +3,7 @@ use warnings;

use FindBin;
use lib "$FindBin::RealBin/lib";
use Catalyst::Middleware::Stash 'stash';

if ( $ENV{PLACK_ENV} eq 'development' ) {

Expand Down
5 changes: 3 additions & 2 deletions lib/MetaCPAN/Server.pm
Expand Up @@ -13,8 +13,9 @@ use Plack::Middleware::ServerStatus::Lite;

extends 'Catalyst';

has api => ( is => 'ro' );
has '+stash' => ( clearer => 'clear_stash' );
has api => ( is => 'ro' );

#has '+stash' => ( clearer => 'clear_stash' );

__PACKAGE__->apply_request_class_roles(
qw(
Expand Down
12 changes: 9 additions & 3 deletions lib/MetaCPAN/Server/Controller/Root.pm
Expand Up @@ -25,23 +25,29 @@ sub get : Path('') : Args(1) {
sub not_found : Private {
my ( $self, $c, @params ) = @_;
my $message = join( '/', @params );
$c->clear_stash;

# XXX fix me
# $c->clear_stash;
$c->stash( { code => 404, message => $message || "Not found" } );
$c->response->status(404);
$c->forward( $c->view('JSON') );
}

sub not_allowed : Private {
my ( $self, $c, $message ) = @_;
$c->clear_stash;

# XXX fix me
# $c->clear_stash;
$c->stash( { message => $message || 'Not allowed' } );
$c->response->status(403);
$c->forward( $c->view('JSON') );
}

sub bad_request : Private {
my ( $self, $c, $message, $code ) = @_;
$c->clear_stash;

# XXX fix me
# $c->clear_stash;
$c->stash( { message => $message || 'Bad request' } );
$c->response->status( $code || 400 );
$c->forward( $c->view('JSON') );
Expand Down

0 comments on commit 9b8fb0e

Please sign in to comment.