Permalink
Browse files

Merge remote-tracking branch 'dylan/lowercase_paths' into pr207

  • Loading branch information...
2 parents f8cd498 + acbb0a4 commit 82421e5bfc0d143da9308d49b4b32dfdb4562231 @sabad66 sabad66 committed Mar 25, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/router.js
View
@@ -31,6 +31,7 @@ Router.prototype.add = function(route, pathOrFunc) {
this.regexRoutes[regexRoute] = pathOrFunc;
}
else {
+ route = route.toLowerCase();
this.simpleRoutes[route] = pathOrFunc;
}
};
@@ -43,6 +44,7 @@ Router.prototype.add = function(route, pathOrFunc) {
* 'res': A Node 'http.serverResponse' object
*/
Router.prototype.handle = function(pathname, req, res) {
+ pathname = pathname.toLowerCase();
if (typeof this.simpleRoutes[pathname] == 'undefined') {
// Look for a match in regex routes
for (r in this.regexRoutes) {

0 comments on commit 82421e5

Please sign in to comment.