summaryrefslogtreecommitdiff
path: root/test/net/http
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-10 23:54:14 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-10 23:54:14 +0000
commit1bf066dcfaeb05130f9b69c2f0928987371ecbc6 (patch)
treeebf95c84ca4a79144df02e11bae121efa2a31d57 /test/net/http
parent8a758e87f226d392705e45b5f4a65e25638ee17d (diff)
Preserve HTTP header key as string [Bug #15394]
to prevent send Host header twice accidentally. From: Sangyong Sim <sangyong-sim@cookpad.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/http')
-rw-r--r--test/net/http/test_httpheader.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb
index f8778522eb..cb4678a805 100644
--- a/test/net/http/test_httpheader.rb
+++ b/test/net/http/test_httpheader.rb
@@ -31,6 +31,11 @@ class HTTPHeaderTest < Test::Unit::TestCase
assert_raise(ArgumentError){ @c.initialize_http_header("foo"=>"a\xff") }
end
+ def test_initialize_with_symbol
+ @c.initialize_http_header(foo: "abc")
+ assert_equal "abc", @c["foo"]
+ end
+
def test_size
assert_equal 0, @c.size
@c['a'] = 'a'