diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-14 15:15:40 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-03-14 15:17:29 -0700 |
commit | 833a90594e9fe25819c5111c853adc91eb6071c2 (patch) | |
tree | 49395eafee74d081334b7aa6730d942bb255ace0 | |
parent | 21b12d89a671131f610dc5600b23cb56839e652b (diff) | |
download | rails-833a90594e9fe25819c5111c853adc91eb6071c2.tar.gz rails-833a90594e9fe25819c5111c853adc91eb6071c2.tar.bz2 rails-833a90594e9fe25819c5111c853adc91eb6071c2.zip |
RegexpWithNamedGroups is only used for path_info, so only apply to path info
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index eae9d4ea6d..0f90b2169d 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -23,7 +23,8 @@ module ActionDispatch conditions[:path_info] = ::Rack::Mount::Strexp.compile(path, requirements, SEPARATORS, anchor) end - @conditions = Hash[conditions.map { |k,v| [k, Rack::Mount::RegexpWithNamedGroups.new(v)] }] + @conditions = conditions.dup + @conditions[:path_info] = Rack::Mount::RegexpWithNamedGroups.new(@conditions[:path_info]) if @conditions[:path_info] @conditions.delete_if{ |k,v| k != :path_info && !valid_condition?(k) } @requirements.delete_if{ |k,v| !valid_condition?(k) } end |