diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-14 12:59:03 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-02-14 12:59:03 +0000 |
commit | 4ae3df42f723d25b0fe4ba6b2689d607b01c6f48 (patch) | |
tree | 26c5f5cf033f79373e63b10f684df07898b7cd8f /lib/rubygems/request.rb | |
parent | d1e6304a891fc5e9cc63e50520bdc798fb95b829 (diff) |
Merge RubyGems master@9be7858f7f17eae3058204f3c03e4b798ba18b9c
This version contains the some style changes by RuboCop.
* https://github.com/rubygems/rubygems/commit/9d810be0ede925fb2e3af535848582c3f8e0e72f
* https://github.com/rubygems/rubygems/commit/61ea98a727fb1b76b6fac52d74107ee4b02aaef2
* https://github.com/rubygems/rubygems/commit/795893dce3c5f8540804fc08144cc6a90f086b13
* https://github.com/rubygems/rubygems/commit/9be7858f7f17eae3058204f3c03e4b798ba18b9c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/request.rb')
-rw-r--r-- | lib/rubygems/request.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rubygems/request.rb b/lib/rubygems/request.rb index d442f6534b..1ed2b8ad50 100644 --- a/lib/rubygems/request.rb +++ b/lib/rubygems/request.rb @@ -13,7 +13,7 @@ class Gem::Request def self.create_with_proxy(uri, request_class, last_modified, proxy) # :nodoc: cert_files = get_cert_files proxy ||= get_proxy_from_env(uri.scheme) - pool = ConnectionPools.new proxy_uri(proxy), cert_files + pool = ConnectionPools.new proxy_uri(proxy), cert_files new(uri, request_class, last_modified, pool.pool_for(uri)) end @@ -168,9 +168,10 @@ class Gem::Request no_env_proxy = env_proxy.nil? || env_proxy.empty? - return :no_proxy if scheme == 'https' && no_env_proxy - return get_proxy_from_env 'http' if no_env_proxy and _scheme != 'http' - return :no_proxy if no_env_proxy + if no_env_proxy + return (_scheme == 'https' || _scheme == 'http') ? + :no_proxy : get_proxy_from_env('http') + end uri = URI(Gem::UriFormatter.new(env_proxy).normalize) |