From fbf6b98c95dfe5d066182feaed3f2c20c4e778c3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Fri, 21 Aug 2015 16:48:46 -0700 Subject: 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 --- actionpack/lib/action_dispatch/http/headers.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionpack/lib/action_dispatch/http/headers.rb') 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? -- cgit v1.2.3