Initial support for :Args attribute
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Path.pm
index 227815f..ceea17b 100644 (file)
@@ -3,6 +3,7 @@ package Catalyst::DispatchType::Path;
 use strict;
 use base qw/Catalyst::DispatchType/;
 use Text::SimpleTable;
+use URI;
 
 =head1 NAME
 
@@ -41,6 +42,7 @@ sub match {
 
     $path ||= '/';
     if ( my $action = $self->{paths}->{$path} ) {
+        return 0 unless $action->match($c);
         $c->req->action($path);
         $c->req->match($path);
         $c->action($action);
@@ -95,6 +97,7 @@ sub register_path {
     my ( $self, $c, $path, $action ) = @_;
     $path =~ s!^/!!;
     $path = '/' unless length $path;
+    $path = URI->new($path)->canonical;
     $self->{paths}{$path} = $action;
 }