X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=f0130271d1daf410c35f8280326190ce21ad3174;hp=03acccc2f93382ddcc4d75fc219c01892a41830d;hb=c1192f1ed63f124eb2d143e10b215703e7dc6284;hpb=130b45ec858db6863e3d6959f7a6e3b6908cd48e diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 03acccc..f013027 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1498,13 +1498,28 @@ sub uri_for { unshift @encoded_args, splice @$captures, $num_captures; } - $path = $c->dispatcher->uri_for_action($action, $captures); + # use Devel::Dwarn;Dwarn $captures; + + if($action->has_captures_constraints) { + unless($action->match_captures($c, $captures)) { + carp "@{$captures} do not match the type constraints in $action"; + } + } + + $path = $c->dispatcher->uri_for_action($action, $captures); if (not defined $path) { $c->log->debug(qq/Can't find uri_for action '$action' @$captures/) if $c->debug; return undef; } $path = '/' if $path eq ''; + + # At this point @encoded_args is the remaining Args (all captures removed). + if($action->has_args_constraints) { + unless($action->match_args($c,\@encoded_args)) { + carp "@encoded_args do not match the type constraints in $action"; + } + } } unshift(@encoded_args, $path); @@ -1567,6 +1582,9 @@ sub uri_for { } @keys); } + warn $base; + warn $args; + my $res = bless(\"${base}${args}${query}", $class); $res; }