X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatchType%2FIndex.pm;h=f8768506377b379bd7bb6164a79e1c25e6765d3e;hp=3caeb5cac87ab6fbbe5e51fe7f24a6dafb5ea452;hb=4082e67814e85bc9820e56eb38e5e21511c0a5f8;hpb=bcccee4e7d7b98c151448074e83c6201ef434476 diff --git a/lib/Catalyst/DispatchType/Index.pm b/lib/Catalyst/DispatchType/Index.pm index 3caeb5c..f876850 100644 --- a/lib/Catalyst/DispatchType/Index.pm +++ b/lib/Catalyst/DispatchType/Index.pm @@ -15,22 +15,18 @@ See L. =head1 METHODS -=over 4 - -=item $self->match( $c, $path ) +=head2 $self->match( $c, $path ) =cut sub match { my ( $self, $c, $path ) = @_; - return if $path =~ m!/!; return if @{ $c->req->args }; - my $result = @{ $c->get_action( 'index', $c->req->path ) || [] }[-1]; + my $result = $c->get_action( 'index', $path ); - # Find default on namespace or super - if ($result) { - $c->action( $result->[0] ); - $c->namespace( $c->req->path ); + if ($result && $result->match($c)) { + $c->action($result); + $c->namespace( $result->namespace ); $c->req->action('index'); $c->req->match( $c->req->path ); return 1; @@ -38,8 +34,6 @@ sub match { return 0; } -=back - =head1 AUTHOR Sebastian Riedel, C