aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/headers.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-06-16 08:01:35 -0300
committerJosé Valim <jose.valim@gmail.com>2011-06-16 08:01:35 -0300
commitf2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3 (patch)
tree8ef6575204ce1e314fa16a5eeb9f9c91667e5f30 /actionpack/lib/action_dispatch/http/headers.rb
parent8775ffa37231d381cba34f0ecacb8a7bbcf0573f (diff)
downloadrails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.tar.gz
rails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.tar.bz2
rails-f2c0fb32c0dce7f8da0ce446e2d2f0cba5fd44b3.zip
Remove usage of memoizable from ActionPack.
Diffstat (limited to 'actionpack/lib/action_dispatch/http/headers.rb')
-rw-r--r--actionpack/lib/action_dispatch/http/headers.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb
index 1e43104f0a..505d5560b1 100644
--- a/actionpack/lib/action_dispatch/http/headers.rb
+++ b/actionpack/lib/action_dispatch/http/headers.rb
@@ -3,9 +3,10 @@ require 'active_support/memoizable'
module ActionDispatch
module Http
class Headers < ::Hash
- extend ActiveSupport::Memoizable
+ @@env_cache = Hash.new { |h,k| h[k] = "HTTP_#{k.upcase.gsub(/-/, '_')}" }
def initialize(*args)
+
if args.size == 1 && args[0].is_a?(Hash)
super()
update(args[0])
@@ -25,9 +26,8 @@ module ActionDispatch
private
# Converts a HTTP header name to an environment variable name.
def env_name(header_name)
- "HTTP_#{header_name.upcase.gsub(/-/, '_')}"
+ @@env_cache[header_name]
end
- memoize :env_name
end
end
end