diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2021-06-14 12:54:37 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-07-07 10:03:15 +0900 |
commit | dd28c03d5fd7a82d1b694a9c2332a55dab81add9 (patch) | |
tree | c19c73eaebe30b9d2e00a31de362723fb9c78da7 /lib/bundler/fetcher/downloader.rb | |
parent | 3e2f089432119cf67017d55f4deef2ea909ceb79 (diff) |
Merge RubyGems-3.2.17 and Bundler-2.2.17
Diffstat (limited to 'lib/bundler/fetcher/downloader.rb')
-rw-r--r-- | lib/bundler/fetcher/downloader.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bundler/fetcher/downloader.rb b/lib/bundler/fetcher/downloader.rb index a2289aaaae..5d30333158 100644 --- a/lib/bundler/fetcher/downloader.rb +++ b/lib/bundler/fetcher/downloader.rb @@ -14,8 +14,10 @@ module Bundler def fetch(uri, headers = {}, counter = 0) raise HTTPError, "Too many redirects" if counter >= redirect_limit + filtered_uri = URICredentialsFilter.credential_filtered_uri(uri) + response = request(uri, headers) - Bundler.ui.debug("HTTP #{response.code} #{response.message} #{uri}") + Bundler.ui.debug("HTTP #{response.code} #{response.message} #{filtered_uri}") case response when Net::HTTPSuccess, Net::HTTPNotModified @@ -40,7 +42,7 @@ module Bundler raise BadAuthenticationError, uri.host if uri.userinfo raise AuthenticationRequiredError, uri.host when Net::HTTPNotFound - raise FallbackError, "Net::HTTPNotFound: #{URICredentialsFilter.credential_filtered_uri(uri)}" + raise FallbackError, "Net::HTTPNotFound: #{filtered_uri}" else raise HTTPError, "#{response.class}#{": #{response.body}" unless response.body.empty?}" end @@ -49,7 +51,9 @@ module Bundler def request(uri, headers) validate_uri_scheme!(uri) - Bundler.ui.debug "HTTP GET #{uri}" + filtered_uri = URICredentialsFilter.credential_filtered_uri(uri) + + Bundler.ui.debug "HTTP GET #{filtered_uri}" req = Net::HTTP::Get.new uri.request_uri, headers if uri.user user = CGI.unescape(uri.user) @@ -69,7 +73,7 @@ module Bundler raise NetworkDownError, "Could not reach host #{uri.host}. Check your network " \ "connection and try again." else - raise HTTPError, "Network error while fetching #{URICredentialsFilter.credential_filtered_uri(uri)}" \ + raise HTTPError, "Network error while fetching #{filtered_uri}" \ " (#{e})" end end |