use strict;
use base qw/Catalyst::DispatchType/;
use Text::SimpleTable;
+use URI;
=head1 NAME
$path ||= '/';
if ( my $action = $self->{paths}->{$path} ) {
+ return 0 unless $action->match($c);
$c->req->action($path);
$c->req->match($path);
$c->action($action);
foreach my $r ( @{ $attrs->{Path} || [] } ) {
unless ($r) {
$r = $action->namespace;
- $r = '/' unless $r;
+ $r = '/' unless length $r;
}
elsif ( $r !~ m!^/! ) { # It's a relative path
$r = $action->namespace . "/$r";
sub register_path {
my ( $self, $c, $path, $action ) = @_;
$path =~ s!^/!!;
- $path = '/' unless $path;
+ $path = '/' unless length $path;
+ $path = URI->new($path)->canonical;
$self->{paths}{$path} = $action;
}