Skip to content

Commit

Permalink
the pattern does not return a bare slash anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 17, 2014
1 parent cf4bd09 commit 6d5f3be
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/Mojolicious/Routes/Route.pm
Expand Up @@ -125,10 +125,9 @@ sub render {

# Render pattern (if necessary)
my $endpoint = !@{$self->children};
if (defined((my $pattern = $self->pattern)->pattern) || $endpoint) {
my $prefix = $pattern->render($values, $endpoint);
$path = "$prefix$path" unless $prefix eq '/';
}
my $pattern = $self->pattern;
$path = $pattern->render($values, $endpoint) . $path
if $endpoint || defined($pattern->pattern);

# Let parent render
return $path =~ m!^/! ? $path : "/$path" unless my $parent = $self->parent;
Expand Down

0 comments on commit 6d5f3be

Please sign in to comment.