Ok, but :year and :month are generic placeholders. According to docs, they
match "match all characters except / and ."
Why .html with dot is matched?
Also I have restricted month and year to only numerics: month => qr/\d{2}/,
year => qr/\d{4}/
Why it matches .html?
Also, this route: $cms_route->route('/members/branches')->to(controller =>
'Admin::Members', action =>
'edit_branches_list')->name('edit_members_branches');
Matches /members/branches.html
But not /members/branches.htm
2015-02-15 13:30 GMT+03:00 Jan Henning Thorsen <[email protected]>:
> The reason is that you have default values set for :year and :month, so
> they get "filled in", when not specified.
>
>
> On Sunday, February 15, 2015 at 10:43:27 AM UTC+1, Stanislav Blinov wrote:
>>
>> Hi,
>> I have a route:
>> $r->get('/news/:year/:month' => [month => qr/\d{2}/, year =>
>> qr/\d{4}/])->to(controller => 'news', action => 'view', year => 2015, month
>> => 01, page => 1, id => $news_id);
>>
>> My intention is that it only should work for these type of urls:
>> /news/
>> news/2015/
>> news/2015/01
>>
>> However, it also works when I call /news.html
>>
>> What is wrong with it?
>> I have also tried adding .html to another routes and it seems that they
>> open the same page as a route without .html
>>
>> Mojolicious 5.79.
>>
>> --
> 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.
>
--
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.