Skip to content

Commit

Permalink
Merge pull request #15012 from schneems/schneems/headers-key
Browse files Browse the repository at this point in the history
HTTP::Headers#key? correctly converts
  • Loading branch information
senny committed May 7, 2014
1 parent cd9222a commit 4214063
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actionpack/lib/action_dispatch/http/headers.rb
Expand Up @@ -26,7 +26,9 @@ def []=(key, value)
@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)
Expand Down
2 changes: 2 additions & 0 deletions actionpack/test/dispatch/header_test.rb
Expand Up @@ -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
Expand Down

0 comments on commit 4214063

Please sign in to comment.