X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=ca5bc2527b493686ca1a235f2abcc578820e7f03;hp=7e0335654379b0f731079046402ae42cc2d731ed;hb=cccc8f68ace5d11c3fdcbfc4e353225b3b574255;hpb=ad5e4650e3b3bff0df6e9f6028c4f21d7470beaa diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 7e03356..ca5bc25 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -282,6 +282,8 @@ sub prepare_action { unshift @args, $arg; } + s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg for grep { defined } @{$c->req->captures||[]}; + $c->log->debug( 'Path is "' . $c->req->match . '"' ) if ( $c->debug && $c->req->match ); @@ -372,7 +374,8 @@ sub uri_for_action { $captures ||= []; foreach my $dispatch_type ( @{ $self->dispatch_types } ) { my $uri = $dispatch_type->uri_for_action( $action, $captures ); - return $uri if defined($uri); + return( $uri eq '' ? '/' : $uri ) + if defined($uri); } return undef; } @@ -497,8 +500,8 @@ sub setup_actions { }; $walker->( $walker, $self->tree, '' ); - $c->log->debug( "Loaded Private actions:\n" . $privates->draw ) - if ($has_private); + $c->log->debug( "Loaded Private actions:\n" . $privates->draw . "\n" ) + if $has_private; # List all public actions $_->list($c) for @{ $self->dispatch_types };