CatalystX::TraitFor::Dispatcher::ExactMatch - handle trailing slashes properly
use Catalyst::Runtime 5.80;
use Catalyst qw/
The Catalyst dispatcher doesn't differentiate between:
Not even with Regex dispatching. Not even by writing a custom dispatch type.
This is apparently a "feature". As far as I'm concerned, it's a bug.
This trait for Catalyst::Dispatcher attempts to perform an exact match, including trailing slashes, ahead of Catalyst's default dispatching. It's not been tested in every possible configuration, but it works for me.
Please report any bugs to http://rt.cpan.org/Dist/Display.html?Queue=CatalystX-TraitFor-Dispatcher-ExactMatch.
Catalyst::Plugin::SanitizeUrl appears to do something similar for pre-Moose versions of Catalyst.
Toby Inkster <firstname.lastname@example.org>.
This software is copyright (c) 2011, 2014 by Toby Inkster.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
To install CatalystX::TraitFor::Dispatcher::ExactMatch, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell
For more information on module installation, please visit the detailed CPAN module installation guide.