aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/http/headers.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2015-08-21 16:48:46 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2015-08-21 16:59:12 -0700
commitfbf6b98c95dfe5d066182feaed3f2c20c4e778c3 (patch)
tree9f517f54ce522446535e1e4c086d40ae767a03d0 /actionpack/lib/action_dispatch/http/headers.rb
parentba2173a10d6578c40f85dcca3bb0314ad7b84963 (diff)
downloadrails-fbf6b98c95dfe5d066182feaed3f2c20c4e778c3.tar.gz
rails-fbf6b98c95dfe5d066182feaed3f2c20c4e778c3.tar.bz2
rails-fbf6b98c95dfe5d066182feaed3f2c20c4e778c3.zip
use accessors on the request object for manipulating env
this reduces the API footprint for the env hash so that we can be more flexible when changing API in the future
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 ca6cf339ed..8e238963c8 100644
--- a/actionpack/lib/action_dispatch/http/headers.rb
+++ b/actionpack/lib/action_dispatch/http/headers.rb
@@ -41,16 +41,16 @@ module ActionDispatch
# Returns the value for the given key mapped to @env.
def [](key)
- env[env_name(key)]
+ @req.get_header env_name(key)
end
# Sets the given value for the key mapped to @env.
def []=(key, value)
- env[env_name(key)] = value
+ @req.set_header env_name(key), value
end
def key?(key)
- env.key? env_name(key)
+ @req.has_header? env_name(key)
end
alias :include? :key?