提交 fbf6b98c 编写于 作者: A Aaron Patterson

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
上级 ba2173a1
......@@ -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?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册