diff options
author | Yves Senn <yves.senn@gmail.com> | 2014-05-07 19:28:16 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2014-05-07 19:28:16 +0200 |
commit | 37c1e47da09fba4ee76143da05bbd4faabbaa53e (patch) | |
tree | 2736027dcaa2b9877c9adf6d0d01c28ee3bdf3cd | |
parent | 37d4415a7b433fcb987b1c6a5b51bf2d8efc5d5e (diff) | |
parent | ca97ec509955d70bde47d337e5086920f0c79b63 (diff) | |
download | rails-37c1e47da09fba4ee76143da05bbd4faabbaa53e.tar.gz rails-37c1e47da09fba4ee76143da05bbd4faabbaa53e.tar.bz2 rails-37c1e47da09fba4ee76143da05bbd4faabbaa53e.zip |
Merge pull request #15012 from schneems/schneems/headers-key
HTTP::Headers#key? correctly converts
-rw-r--r-- | actionpack/lib/action_dispatch/http/headers.rb | 4 | ||||
-rw-r--r-- | actionpack/test/dispatch/header_test.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/http/headers.rb b/actionpack/lib/action_dispatch/http/headers.rb index 2666cd4b0a..788eed8b89 100644 --- a/actionpack/lib/action_dispatch/http/headers.rb +++ b/actionpack/lib/action_dispatch/http/headers.rb @@ -26,7 +26,9 @@ module ActionDispatch @env[env_name(key)] = value end - def key?(key); @env.key? key; end + def key?(key) + @env.key? env_name(key) + end alias :include? :key? def fetch(key, *args, &block) diff --git a/actionpack/test/dispatch/header_test.rb b/actionpack/test/dispatch/header_test.rb index 9e37b96951..e2b38c23bc 100644 --- a/actionpack/test/dispatch/header_test.rb +++ b/actionpack/test/dispatch/header_test.rb @@ -55,6 +55,8 @@ class HeaderTest < ActiveSupport::TestCase test "key?" do assert @headers.key?("CONTENT_TYPE") assert @headers.include?("CONTENT_TYPE") + assert @headers.key?("Content-Type") + assert @headers.include?("Content-Type") end test "fetch with block" do |