Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove unnecessary caching
`ActiveSupport::Dependencies.constantize(const_name)` calls
`Reference.new` which is defined as
`ActiveSupport::Dependencies.constantize(const_name)` meaning this call
is already cached and we're doing caching that isn't necessary.

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

Conflicts:
	actionpack/lib/action_dispatch/routing/route_set.rb

CVE-2015-7581
  • Loading branch information
eileencodes authored and tenderlove committed Jan 22, 2016
1 parent 50d3d7d commit 98629df
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions actionpack/lib/action_dispatch/routing/route_set.rb
@@ -1,6 +1,5 @@
require 'action_dispatch/journey'
require 'forwardable'
require 'thread_safe'
require 'active_support/concern'
require 'active_support/core_ext/object/to_query'
require 'active_support/core_ext/hash/slice'
Expand All @@ -24,7 +23,6 @@ class Dispatcher #:nodoc:
def initialize(options={})
@defaults = options[:defaults]
@glob_param = options.delete(:glob)
@controller_class_names = ThreadSafe::Cache.new
end

def call(env)
Expand Down Expand Up @@ -74,7 +72,7 @@ def controller(params, default_controller=true)
private

def controller_reference(controller_param)
const_name = @controller_class_names[controller_param] ||= "#{controller_param.camelize}Controller"
const_name = "#{controller_param.camelize}Controller"
ActiveSupport::Dependencies.constantize(const_name)
end

Expand Down

0 comments on commit 98629df

Please sign in to comment.