[前][次][番号順一覧][スレッド一覧]

ruby-changes:52003

From: hsbt <ko1@a...>
Date: Tue, 7 Aug 2018 22:08:59 +0900 (JST)
Subject: [ruby-changes:52003] hsbt:r64218 (trunk): Silence Net::HTTP warning in test.

hsbt	2018-08-07 22:08:53 +0900 (Tue, 07 Aug 2018)

  New Revision: 64218

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64218

  Log:
    Silence Net::HTTP warning in test.
    
      https://github.com/ruby/webrick/pull/8
    
      Co-authored-by: Espartaco Palma <>

  Modified files:
    trunk/test/webrick/test_httpproxy.rb
Index: test/webrick/test_httpproxy.rb
===================================================================
--- test/webrick/test_httpproxy.rb	(revision 64217)
+++ test/webrick/test_httpproxy.rb	(revision 64218)
@@ -64,6 +64,7 @@ class TestWEBrickHTTPProxy < Test::Unit: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpproxy.rb#L64
 
       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: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpproxy.rb#L109
       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: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpproxy.rb#L338
 
         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: https://github.com/ruby/ruby/blob/trunk/test/webrick/test_httpproxy.rb#L383
 
             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)
             }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]