No commit activity in last 3 years
No release in over 3 years
A rack middleware to enforce appending or removing trailing slashes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

rack-slashenforce

A rack middleware to enforce appending or removing trailing slashes from URLs.

Setup

$ gem install rack-slashenforce

Bundler users

If you use Bundler, you will need to add it to your Gemfile.

gem 'rack-slashenforce', :require => 'rack'

Usage

Add one of the following lines to config.ru:

To enforce a trailing slash on all urls without a period in them:

use Rack::AppendTrailingSlash

To enforce no trailing slashes on any urls:

use Rack::RemoveTrailingSlashes

For a more robust solution, see rack-rewrite.

Copyright (c) 2012 Tyler Kellen. See LICENSE for further details.