From 5026a663ab3e01600131b9bd84c672548a1cd3d8 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 28 Jun 2016 06:20:20 +0000 Subject: Cache no proxy case * lib/net/http.rb (Net::HTTP#proxy_uri): cache the case no proxy is used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/net/http.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/net/http.rb b/lib/net/http.rb index 326d737692..4738bc621a 100644 --- a/lib/net/http.rb +++ b/lib/net/http.rb @@ -1049,9 +1049,11 @@ module Net #:nodoc: # The proxy URI determined from the environment for this connection. def proxy_uri # :nodoc: + return if @proxy_uri == false @proxy_uri ||= URI::HTTP.new( "http".freeze, nil, address, port, nil, nil, nil, nil, nil - ).find_proxy + ).find_proxy || false + @proxy_uri || nil end # The address of the proxy server, if one is configured. -- cgit v1.2.3