Hi.

I have problem with routing in Mojolicious > 5.15.

  my $r = $self->routes;
>   $r->get('/tags/:tag.rss')->to('router#tags_tag_rss');
>   $r->get('/tags/:tag')->to('router#tags_tag');


In M 5.15

> % ./script/mojo_twist routes --verbose
> ...
> /tags/:tag.rss                ....  GET  tagstagrss             
> ^/tags/([^\/\.]+)*\.rss*(?:\.([^/]+)$)?
> /tags/:tag                    ....  GET  tagstag               
>  ^/tags/([^\/\.]+)(?:\.([^/]+)$)?


In M 5.16

> % ./script/mojo_twist routes --verbose
> ...
> /tags/:tag.rss                ....  GET  tagstagrss             
> ^/tags/([^\/\.]+)(?:\.([^/]+)$)?
> /tags/:tag                    ....  GET  tagstag               
>  ^/tags/([^\/\.]+)(?:\.([^/]+)$)?


I think this happened after Mojolicious::Routes::Pattern::_tokenize has 
been changed
https://github.com/kraih/mojo/commit/7cb6a3a34805345415bf2f9d4e6c128d8c7e908d#diff-2650135fc08c671d8b875d9b8480f498

I tried to fix my problem with:
1. $r->get('/tags/:tag', format => 'rss')->to('router#tags_tag_rss');
routes --verbose
/tags/:tag                    .C..  GET  tagstag               
 ^/tags/([^\/\.]+)(?:\.([^/]+)$)?

2. $r->get('/tags/:tag', tag => qr/rss$/)->to('router#tags_tag_rss');

routes --verbose
/tags/:tag                    .C..  GET  tagstag               
 ^/tags/([^\/\.]+)(?:\.([^/]+)$)?

None of these solutions work. App always trying call router#tags_tag.

How to fix a problem with routing if this behavior is normal?

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.

Reply via email to