Plack::Middleware::TrailingSlashKiller - Dealing with that pesky trailing slash/
builder { enable "TrailingSlashKiller", redirect => 1 };
Plack::Middleware::TrailingSlashKiller will look for trailing slashes in the requested URL and remove them. Based on the redirect option, it will either redirect or silently rewrite the URL before passing it on to the app.
Plack::Middleware::TrailingSlashKiller
redirect
This module was written with Dancer2 in mind, where /path and /path/ are different (and the latter usually results in a 404).
/path
/path/
This boolean will instruct the module to either return 301 (GET/HEAD) and 307 (other) results with a Location header or to silently rewrite the URL without a trailing slash.
Plack::Middleware
Menno Blom <blom@cpan.org>
Copyright 2015- Menno Blom
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::TrailingSlashKiller, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::TrailingSlashKiller
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::TrailingSlashKiller
For more information on module installation, please visit the detailed CPAN module installation guide.