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=858c1ec579a6c7177e852ec3fbc30a864d7afdb6;hp=ac641a95dddef741bd62586ff3ed5ec43f80c20e;hb=4082e67814e85bc9820e56eb38e5e21511c0a5f8;hpb=b5ecfcf07b8ffe7e9984f0279c8781ce51c6ac6a diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index ac641a9..858c1ec 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -21,10 +21,10 @@ __PACKAGE__->mk_accessors( ); # Preload these action types -our @PRELOAD = qw/Path Regex/; +our @PRELOAD = qw/Index Path Regex/; # Postload these action types -our @POSTLOAD = qw/Index Default/; +our @POSTLOAD = qw/Default/; =head1 NAME @@ -120,8 +120,10 @@ sub forward { unless ($result) { - my $class = ref($command) || ref( $c->component($command) ); - my $method = shift || 'process'; + my $class = ref($command) + || ref( $c->component($command) ) + || $c->component($command); + my $method = shift || 'process'; unless ($class) { my $error = @@ -176,12 +178,13 @@ sub prepare_action { my @path = split /\//, $c->req->path; $c->req->args( \my @args ); - push( @path, '/' ) unless @path; # Root action + unshift( @path, '' ); # Root action DESCEND: while (@path) { $path = join '/', @path; + $path =~ s#^/##; - $path = '' if $path eq '/'; # Root action + $path = '' if $path eq '/'; # Root action # Check out dispatch types to see if any will handle the path at # this level @@ -191,7 +194,9 @@ sub prepare_action { } # If not, move the last part path to args - unshift @args, pop @path; + my $arg = pop(@path); + $arg =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg; + unshift @args, $arg; } $c->log->debug( 'Path is "' . $c->req->match . '"' )