Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Routes are case sensitive

#393

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

Reported by Pete P. · June 11th, 2008 @ 07:20 PM

State: wontfix
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Pete P.
    Pete P.

    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

    June 13th, 2008 @ 08:09 PM

  2. Pete P.
    Pete P.

    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

    June 13th, 2008 @ 08:29 PM

  3. Jeff Dean
    Jeff Dean

    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.

    June 19th, 2008 @ 03:44 AM

  4. Pratik
    Pratik
    • 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.

    July 23rd, 2008 @ 02:08 PM

  5. Carsten Gehling
    Carsten Gehling

    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/

    February 27th, 2010 @ 03:03 PM

  6. Jeff Dean
    Jeff Dean

    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?

    June 12th, 2010 @ 01:34 AM