summaryrefslogtreecommitdiff
path: root/lib/bundler/vendored_persistent.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-06-11 12:48:34 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-24 21:43:07 +0200
commit0575baa6bb50264964c6c1896218e83ef7ed5025 (patch)
tree179418cb4559ddc971cf4f57bddf98b379e58239 /lib/bundler/vendored_persistent.rb
parenta8874423f347efa52d69b332cc855def812e9b5b (diff)
downloadbundler-0575baa6bb50264964c6c1896218e83ef7ed5025.tar.gz
Bump net-http-persistent to 3.0.1
* Adds an extra artifice task to vendorize new `connection_pool` dependency. * Cherry-pick's needed Windows fix not yet merged into master branch of `net-http-persistent`. * Update bundler usages to be compatible with the new version, and fix unit specs.
Diffstat (limited to 'lib/bundler/vendored_persistent.rb')
-rw-r--r--lib/bundler/vendored_persistent.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/bundler/vendored_persistent.rb b/lib/bundler/vendored_persistent.rb
index 7670b83992..045a761dac 100644
--- a/lib/bundler/vendored_persistent.rb
+++ b/lib/bundler/vendored_persistent.rb
@@ -20,13 +20,15 @@ require_relative "vendor/net-http-persistent/lib/net/http/persistent"
module Bundler
class PersistentHTTP < Persistent::Net::HTTP::Persistent
def connection_for(uri)
- connection = super
- warn_old_tls_version_rubygems_connection(uri, connection)
- connection
+ super(uri) do |connection|
+ result = yield connection
+ warn_old_tls_version_rubygems_connection(uri, connection)
+ result
+ end
end
def warn_old_tls_version_rubygems_connection(uri, connection)
- return unless connection.use_ssl?
+ return unless connection.http.use_ssl?
return unless (uri.host || "").end_with?("rubygems.org")
socket = connection.instance_variable_get(:@socket)