Add a few more tests for this issue in various other positions and dispatch types...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / DispatchType / Chained.pm
index b0e3f53..8600ac0 100644 (file)
@@ -329,7 +329,9 @@ sub uri_for_action {
         if (my $cap = $curr->attributes->{CaptureArgs}) {
             return undef unless @captures >= $cap->[0]; # not enough captures
             if ($cap->[0]) {
-                unshift(@parts, splice(@captures, -$cap->[0]));
+                unshift(@parts,
+                    map { s/([^A-Za-z0-9\-_.!~*'()])/$URI::Escape::escapes{$1}/go; $_; }
+                    splice(@captures, -$cap->[0]));
             }
         }
         if (my $pp = $curr->attributes->{PartPath}) {