This project is archived and is in readonly mode.
Routes are case sensitive
Reported by Pete P. | June 11th, 2008 @ 07:20 PM
All routes are by default case sensitive, so map.connect 'about', :controller=>"about", :action=>"index" is not recognized by a request to /About.
I'm not too sure what the default behavior should be, but case sensitivity should at least be an option when specifying routes in routing.rb
In the meantime, as a work around, I'm going to patch up ActionController::Routing#recognition_conditions to return a case insensitive Regexp
Comments and changes to this ticket
-
Pete P. June 13th, 2008 @ 08:09 PM
Fyi,
RFC 1738 - Uniform Resource Locators (URL) - Section 2.1
..."For resiliency, programs interpreting URLs should treat upper case letters as equivalent to lower case in scheme names (e.g., allow "HTTP" as well as "http")."
http://www.faqs.org/rfcs/rfc1738... section 2.1
-
Pete P. June 13th, 2008 @ 08:29 PM
Ok, so in the above RFC spec its really just referring to the scheme portion of the url, not the path.
But in any case, consider the usability of having case sensitive routes
-
Jeff Dean June 19th, 2008 @ 03:44 AM
Not only that, but in 37Signals' own book Defensive Web Design they talk about how important case-insensitive urls are.
I agree that the path portion of urls should be case-insensitive.
-
Pratik July 23rd, 2008 @ 02:08 PM
- State changed from new to wontfix
- Tag set to routes
URI should be case sensitive by default. It might be nice to give option to make them insenitive though.
Thanks.
-
Carsten Gehling February 27th, 2010 @ 03:03 PM
I know this is an old post, but I've just has the same problem, and solved it using middelware - have a look here:
http://gehling.dk/2010/02/how-to-make-rails-routing-case-insensitive/
-
Jeff Dean June 12th, 2010 @ 01:34 AM
Pratik - any chance you could elaborate on why routes should be case-sensitive?
Are you aware of any apps in production that rely on case-sensitive routes? Is there a compelling performance reason to not call downcase on the incoming path when matching?
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>