This project is archived and is in readonly mode.
Regexp ignore-case option in routes breaks params
-
Andrew Bloomgarden
- Title changed from Two regexp options in routing breaks params to Regexp ignore-case option in routes breaks params
-
DHH
- Milestone cleared.
- Assigned user set to josh
-
Andrew Bloomgarden
Attached is a patch with a couple of failing tests.
-
Andrew Bloomgarden
Alright, I believe I've found the issue. Given this in the routing test:
controller :articles do scope '/articles', :name_prefix => 'article' do scope :path => '/:title', :title => /[a-z]+/i, :as => :with_title do match '/:id', :to => :with_id end end endthe Rack::Mount::Route for article_with_title has named_captures
{:path_info=>{:title=>0, :id=>2}}but without the ignore-case flag it has
{:path_info=>{:title=>0, :id=>1}}Now to actually fix it…
-
Andrew Bloomgarden
- Tag changed from rails3 routes, bug, rails3, regression to rails3 routes, bug, rack-mount, rails3, regression
Turns out this is a rack-mount issue, so I've attached a failing test case for that.
-
Andrew Bloomgarden
- Tag changed from rails3 routes, bug, rack-mount, rails3, regression to rails3 routes, bug, patch, rack-mount, rails3, regression
And here's a fix. RegexpWithNamedGroups was treating (?i-mx:blah) and the like as captures.
-
Andrew Bloomgarden
One last patchfile, this one with an explicit test added for RegexpWithNamedGroups.
-
Andrew Bloomgarden
And that makes the ActionDispatch test pass, as expected.
