Add trailing slash to urls in dev and production #174
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.