Test and fix for a case which caused uri_for to generate a double slash at the start...
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 8cb6866..63c2fb7 100644 (file)
@@ -1077,7 +1077,7 @@ sub uri_for {
     # join args with '/', or a blank string
     my $args = join('/', grep { defined($_) } @args);
     $args =~ s/\?/%3F/g; # STUPID STUPID SPECIAL CASE
-    $args =~ s!^/!!;
+    $args =~ s!^/+!!;
     my $base = $c->req->base;
     my $class = ref($base);
     $base =~ s{(?<!/)$}{/};