summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2017-06-23 03:05:34 +0000
committerThe Bundler Bot <bot@bundler.io>2017-06-23 03:05:34 +0000
commit4dfff8be27b6582052c24fd58de46bf14763b83c (patch)
tree37cf8d6fad02ea135f17a36dd5dd6f37e5a98be5 /lib
parentaf5c9d95d0b06b1148cce53366adc8acc93dd43a (diff)
parent880ea03b215c1584cd8d4c7bdada95873e2d8c01 (diff)
downloadbundler-4dfff8be27b6582052c24fd58de46bf14763b83c.tar.gz
Auto merge of #5801 - jakauppila:fix_no_proxy_patch, r=segiddins
Add explicit nil proxy arguments - Fixes no_proxy support ### What was the end-user problem that led to this PR? When the `no_proxy` environment variable is configured it is not being honored and requests for hosts that are present in the list will be sent through the proxy defined via `http_proxy` and `https_proxy`. Ultimately this means that a user utilizing the `http_proxy`, `https_proxy`, and `no_proxy` environment variables will unable to access an internal RubyGems source. ### Was was your diagnosis of the problem? The underlying `net-http-persistent` gem currently does not explicitly pass in nil arguments when a host matches a value within `no_proxy`, so when `Net::HTTP.new()` is called, it will fall back an utilize the values defined in `http_proxy` and `https_proxy`. https://github.com/drbrain/net-http-persistent/pull/88 has been submitted to add the explicit nil argument to be defined. ### What is your fix for the problem, implemented in this PR? Adding explicit nil arguments for the proxy definition for `Net::HTTP.new()` as defined by the documentation. https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html#method-c-new ### Why did you choose this fix out of the possible options? Per the discussion in https://github.com/bundler/bundler/issues/5781, as Bundler is currently stuck to v2.9.4 of `net-http-persistent` for now, it would be best addressed by a change to the vendored code. A PR has been submitted to `net-http-persistent` which can be pulled into Bundler when v3.x will be integrated.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
index 1f8273cadc..7cbca5bc06 100644
--- a/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
+++ b/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb
@@ -616,6 +616,8 @@ class Bundler::Persistent::Net::HTTP::Persistent
if @proxy_uri and not proxy_bypass? uri.host, uri.port then
connection_id << @proxy_connection_id
net_http_args.concat @proxy_args
+ else
+ net_http_args.concat [nil, nil, nil, nil]
end
connection = connections[connection_id]