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

ruby-changes:61670

From: John <ko1@a...>
Date: Thu, 11 Jun 2020 13:42:20 +0900 (JST)
Subject: [ruby-changes:61670] 6742fcf553 (master): [ruby/webrick] Extract creation of Net::HTTP in httpproxy

https://git.ruby-lang.org/ruby.git/commit/?id=6742fcf553

From 6742fcf5531f29b1cce33ab32895513b87f3f53e Mon Sep 17 00:00:00 2001
From: John W Higgins <wishdev@g...>
Date: Thu, 21 May 2020 11:22:18 -0700
Subject: [ruby/webrick] Extract creation of Net::HTTP in httpproxy

https://github.com/ruby/webrick/commit/e58195faf8

diff --git a/lib/webrick/httpproxy.rb b/lib/webrick/httpproxy.rb
index d05d595..496a3ff 100644
--- a/lib/webrick/httpproxy.rb
+++ b/lib/webrick/httpproxy.rb
@@ -295,6 +295,10 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpproxy.rb#L295
       return FakeProxyURI
     end
 
+    def create_net_http(uri, upstream)
+      Net::HTTP.new(uri.host, uri.port, upstream.host, upstream.port)
+    end
+
     def perform_proxy_request(req, res, req_class, body_stream = nil)
       uri = req.request_uri
       path = uri.path.dup
@@ -303,7 +307,7 @@ module WEBrick https://github.com/ruby/ruby/blob/trunk/lib/webrick/httpproxy.rb#L307
       upstream = setup_upstream_proxy_authentication(req, res, header)
 
       body_tmp = []
-      http = Net::HTTP.new(uri.host, uri.port, upstream.host, upstream.port)
+      http = create_net_http(uri, upstream)
       req_fib = Fiber.new do
         http.start do
           if @config[:ProxyTimeout]
-- 
cgit v0.10.2


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

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