1 package TestAppDoubleAutoBug::Context;
3 extends 'Catalyst::Context';
5 if (eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
6 with 'CatalystX::LeakChecker';
10 default => sub { [] },
15 my ($ctx, @leaks) = @_;
16 push @{ $ctx->leaks }, @leaks;
21 return scalar @{ $ctx->leaks };
26 my $class = ref( $c->component( $_[0] ) ) || $_[0];
27 my $action = $_[1]->reverse;
31 if ( $action =~ /->(\w+)$/ ) {
34 elsif ( $action =~ /\/(\w+)$/ ) {
37 elsif ( $action =~ /^(\w+)$/ ) {
41 if ( $class && $method && $method !~ /^_/ ) {
42 my $executed = sprintf( "%s->%s", $class, $method );
43 my @executed = $c->response->headers->header('X-Catalyst-Executed');
44 push @executed, $executed;
45 $c->response->headers->header(
46 'X-Catalyst-Executed' => join ', ',
50 no warnings 'recursion';
51 return $c->SUPER::execute(@_);
54 after prepare_action => sub{
56 $c->res->header( 'X-Catalyst-Action' => $c->req->action );