diff options
| author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-05 09:45:30 +0000 | 
|---|---|---|
| committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-05 09:45:30 +0000 | 
| commit | 74961dbbe90d60e8c892005fc92e4943abd46272 (patch) | |
| tree | 13f3e39fbcc7e5b7d5d6452cf2dab34dddecd313 /actionpack/lib/action_controller | |
| parent | 26ccf4cb538431feed52565e4cac4a9421dffa53 (diff) | |
| download | rails-74961dbbe90d60e8c892005fc92e4943abd46272.tar.gz rails-74961dbbe90d60e8c892005fc92e4943abd46272.tar.bz2 rails-74961dbbe90d60e8c892005fc92e4943abd46272.zip | |
Backed out of #1694 as it broke requests that hit the cache with wrong argument type nil (expected Module) on WEBrick
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1705 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
| -rw-r--r-- | actionpack/lib/action_controller/routing.rb | 36 | 
1 files changed, 12 insertions, 24 deletions
| diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index dcc3b2851b..7be27b2eea 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -416,33 +416,21 @@ module ActionController          return (method_sources << code)        end -      @@recognized_route_cache = {}        def recognize(request) -        if recognized = @@recognized_route_cache[request.path] -          controller, options = recognized -          request.path_parameters = options -          controller.new -        else -          string_path = request.path -          string_path.chomp! if string_path[0] == ?/ -          path = string_path.split '/' -          path.shift -       -          hash = recognize_path(path) -          recognition_failed(request) unless hash && hash['controller'] -       -          controller = hash['controller'] -          hash['controller'] = controller.controller_path -          request.path_parameters = hash -          @@recognized_route_cache[request.path] = [controller, hash] -          controller.new -        end +        string_path = request.path   +        string_path.chomp! if string_path[0] == ?/   +        path = string_path.split '/'   +        path.shift   +    +        hash = recognize_path(path)   +        recognition_failed(request) unless hash && hash['controller']   +    +        controller = hash['controller']   +        hash['controller'] = controller.controller_path   +        request.path_parameters = hash   +        controller.new         end        alias :recognize! :recognize - -      def clear_recognized_route_cache! -        @@recognized_route_cache.clear -      end        def recognition_failed(request)          raise ActionController::RoutingError, "Recognition failed for #{request.path.inspect}" | 
