iron/router — pull request #52 by z0rch (2014-11-19 14:47:26+00:00)
Title: Support trailing shashes in URLs

Suppose you have defined a route:

router.get("/hello/:name", Server::hello);

I'd like to be able to access it with both URLs:

http://localhost/hello/world
http://localhost/hello/world/

However, currently the latter one gives me 500 Internal Server Error.

I know sometimes people implement 301 permanent redirect for a route with slash, sometimes create a parameter to control whether URL with trailing slash should be treated differently than the one without slash.

For the sake of simplicity, as you can see in this pull request, I propose just to ignore the trailing slash, and treat both URLs as valid for the registered handler.
If this becomes an important scenario, we could revisit it later on.