prefix disallows trailing slashes?
I had a bunch of stuff in one app and today I upgraded Dancer to latest and made sure everything worked, then I split out the main stuff "prefix undef;" into MyApp::Web::Root and then my "forums" stuff into MyApp::Web::Forum with prefix '/forums'; When I did this, my routes under /forums (other than "/") don't allow the trailing slashes anymore. For example, I have a route: any '/:name/new_topic/' => sub { ... }; But if I access /forums/some_name/new_topic/ I get Error 404. If I change it to /forums/some_name/new_topic (note missing trailing slash) it works. So it seems that having trailing slashes in routes works under prefix undef; but doesn't work (properly) under other prefixes. Thanks, Brian
I made a pull request: https://github.com/sukria/Dancer/pull/412 It also caught the last pull request I made (again) even though you already accepted it a long time ago. I don't really know how to use github effectively yet, sorry :( Brian On Mon, Mar 21, 2011 at 5:09 PM, Brian E. Lozier <brian@massassi.com> wrote:
I had a bunch of stuff in one app and today I upgraded Dancer to latest and made sure everything worked, then I split out the main stuff "prefix undef;" into MyApp::Web::Root and then my "forums" stuff into MyApp::Web::Forum with prefix '/forums';
When I did this, my routes under /forums (other than "/") don't allow the trailing slashes anymore. For example, I have a route:
any '/:name/new_topic/' => sub { ... };
But if I access /forums/some_name/new_topic/ I get Error 404. If I change it to /forums/some_name/new_topic (note missing trailing slash) it works. So it seems that having trailing slashes in routes works under prefix undef; but doesn't work (properly) under other prefixes.
Thanks, Brian
participants (1)
-
Brian E. Lozier