11 Sep 2014 09:53:55 UTC
- Distribution: CatalystX-TraitFor-Dispatcher-ExactMatch
- Module version: 0.003
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (0)
- Testers (396 / 0 / 13)
- KwaliteeBus factor: 1
- 100.00% Coverage
- License: perl_5
- Activity24 month
- Download (14.32KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionTOBYINK Toby Inkster
CatalystX::TraitFor::Dispatcher::ExactMatch - handle trailing slashes properly
package MyApp; use Catalyst::Runtime 5.80; use Catalyst qw/ -Debug Static::Simple /; use CatalystX::RoleApplicator; __PACKAGE__->apply_dispatcher_class_roles( qw/CatalystX::TraitFor::Dispatcher::ExactMatch/ );
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 <email@example.com>.
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.
Module Install Instructions
To install CatalystX::TraitFor::Dispatcher::ExactMatch, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install CatalystX::TraitFor::Dispatcher::ExactMatch
For more information on module installation, please visit the detailed CPAN module installation guide.