aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/base/headers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/base/headers.rb')
-rw-r--r--actionpack/lib/action_controller/base/headers.rb33
1 files changed, 0 insertions, 33 deletions
diff --git a/actionpack/lib/action_controller/base/headers.rb b/actionpack/lib/action_controller/base/headers.rb
deleted file mode 100644
index 139669c66f..0000000000
--- a/actionpack/lib/action_controller/base/headers.rb
+++ /dev/null
@@ -1,33 +0,0 @@
-require 'active_support/memoizable'
-
-module ActionController
- module Http
- class Headers < ::Hash
- extend ActiveSupport::Memoizable
-
- def initialize(*args)
- if args.size == 1 && args[0].is_a?(Hash)
- super()
- update(args[0])
- else
- super
- end
- end
-
- def [](header_name)
- if include?(header_name)
- super
- else
- super(env_name(header_name))
- end
- end
-
- private
- # Converts a HTTP header name to an environment variable name.
- def env_name(header_name)
- "HTTP_#{header_name.upcase.gsub(/-/, '_')}"
- end
- memoize :env_name
- end
- end
-end