summaryrefslogtreecommitdiff
path: root/test/net
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-29 01:46:02 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-01-29 01:46:02 +0000
commit809d3770e69e72913358d8da5e779d0334d4c5cb (patch)
treeb490f549ec575cfbe57fc47d78399ddb26b1edfd /test/net
parent0897a6df5e49ccce57ec0878a4169a90aceb1d92 (diff)
* lib/net/http/header.rb: Warn nil variable on HTTP Header.
It caused to NoMethodError. [fix GH-952][fix GH-641] Patch by @teosz * test/net/http/test_httpheader.rb: Added test for nil HTTP Header. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net')
-rw-r--r--test/net/http/test_httpheader.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/net/http/test_httpheader.rb b/test/net/http/test_httpheader.rb
index 2f3a0f1..5f56816 100644
--- a/test/net/http/test_httpheader.rb
+++ b/test/net/http/test_httpheader.rb
@@ -82,6 +82,12 @@ class HTTPHeaderTest < Test::Unit::TestCase
assert_equal ['test string'], @c.get_fields('my-header')
end
+ class D; include Net::HTTPHeader; end
+
+ def test_nil_variable_header
+ assert_nothing_raised { D.new.initialize_http_header({Authorization: nil}) }
+ end
+
def test_delete
@c['My-Header'] = 'test'
assert_equal 'test', @c['My-Header']