From dfd6787f4602394dcb7c83fbb1bb8dee0251624d Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 7 Aug 2018 13:08:53 +0000 Subject: Silence Net::HTTP warning in test. https://github.com/ruby/webrick/pull/8 Co-authored-by: Espartaco Palma <> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/webrick/test_httpproxy.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/webrick/test_httpproxy.rb b/test/webrick/test_httpproxy.rb index b165a924d8..4eef12a47d 100644 --- a/test/webrick/test_httpproxy.rb +++ b/test/webrick/test_httpproxy.rb @@ -64,6 +64,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase req = Net::HTTP::Post.new("/") req.body = "post-data" + req.content_type = "application/x-www-form-urlencoded" http.request(req){|res| assert_equal("1.1 localhost.localdomain:#{port}", res["via"], log.call) assert_equal("POST / post-data", res.body, log.call) @@ -108,6 +109,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase assert_equal(2, request_handler_called, log.call) req = Net::HTTP::Post.new("/") + req.content_type = "application/x-www-form-urlencoded" req.body = "post-data" http.request(req){|res| assert_nil(res["via"], log.call) @@ -336,6 +338,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase req = Net::HTTP::Post.new("/") req.body = "post-data" + req.content_type = "application/x-www-form-urlencoded" http.request(req){|res| via = res["via"].split(/,\s+/) assert(via.include?("1.1 localhost.localdomain:#{up_port}"), up_log.call + log.call) @@ -380,6 +383,7 @@ class TestWEBrickHTTPProxy < Test::Unit::TestCase req2 = Net::HTTP::Post.new("/") req2.body = "post-data" + req2.content_type = "application/x-www-form-urlencoded" http.request(req2){|res| assert_equal("SSL POST / post-data", res.body, up_log.call + log.call + s_log.call) } -- cgit v1.2.3