sub get_action {
my ( $c, $action, $namespace ) = @_;
+ return [] unless $action;
$namespace ||= '';
if ($namespace) {
$namespace = '' if $namespace eq '/';
for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) {
$c->state( $c->execute( @{ $begin->[0] } ) );
}
- for my $result ( @{ $c->get_action( $action, $default ) }[-1] )
- {
- $c->state( $c->execute( @{ $result->[0] } ) );
- last unless $default;
+ if ( my $action = $c->req->action ) {
+ for my $result (
+ @{ $c->get_action( $action, $default ) }[-1] )
+ {
+ $c->state( $c->execute( @{ $result->[0] } ) );
+ last unless $default;
+ }
}
for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } )
{
my $av = sprintf '%.3f', 1 / $elapsed;
my $t = Text::ASCIITable->new;
$t->setCols( 'Action', 'Time' );
- $t->setColWidth( 'Action', 65, 1 );
- $t->setColWidth( 'Time', 8, 1 );
+ $t->setColWidth( 'Action', 64, 1 );
+ $t->setColWidth( 'Time', 9, 1 );
for my $stat (@stats) {
$t->addRow(@$stat);
if ( $c->debug ) {
my $secs = time - $START || 1;
my $av = sprintf '%.3f', $COUNT / $secs;
- $c->log->debug('********************************');
+ $c->log->debug('**********************************');
$c->log->debug("* Request $COUNT ($av/s) [$$]");
- $c->log->debug('********************************');
+ $c->log->debug('**********************************');
$c->res->headers->header( 'X-Catalyst' => $Catalyst::VERSION );
}
$c->prepare_request($r);