diff options
author | The Bundler Bot <bot@bundler.io> | 2017-06-23 03:05:34 +0000 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-17 12:03:17 -0500 |
commit | 825b06819831613a33d55ecdf819cc8935243002 (patch) | |
tree | f831d5721f2c710412c08182d59a294f842ce9d0 /lib | |
parent | abd487c2d7cb21def85d9660f17328a62eeaf638 (diff) | |
download | bundler-825b06819831613a33d55ecdf819cc8935243002.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.
(cherry picked from commit 4dfff8be27b6582052c24fd58de46bf14763b83c)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb | 2 |
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 5195be2152..c872a79c13 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] |