Permalink
Browse files

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
  • Loading branch information...
tenderlove committed Aug 21, 2015
1 parent ba2173a commit fbf6b98c95dfe5d066182feaed3f2c20c4e778c3
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/http/headers.rb
@@ -41,16 +41,16 @@ def initialize(request) # :nodoc:
# 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?

0 comments on commit fbf6b98

Please sign in to comment.