ruhoh/ruhoh.rb — pull request #174 by binaryphile (2013-05-31 17:52:16+00:00)
Title: Add trailing slash to urls in dev and production

This isn't so much a real pull request as it is a proof of concept.

In production I've had to add trailing slashes to all pretty urls so that when hosting on S3 I don't get redirects on every page (from non-slashed to slashed), thereby slowing down the site unnecessarily.

Since running in development runs off the same code, and I wasn't tricky enough to build in a configuration option, I had to make development accept the trailing slashes as well. Here's the code which does both in this commit.

My suggestion would be to create a configuration option which gives control over precisely this behavior. With a little guidance I could probably do it and resubmit, but I'm tossing this over the wall anyway right now so at least you know about what's involved.