aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/remote_fetcher.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/remote_fetcher.rb')
-rw-r--r--lib/rubygems/remote_fetcher.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb
index fda1e067ef..a2d8ba45e3 100644
--- a/lib/rubygems/remote_fetcher.rb
+++ b/lib/rubygems/remote_fetcher.rb
@@ -27,7 +27,13 @@ class Gem::RemoteFetcher
def initialize(message, uri)
super message
- @uri = uri
+ begin
+ uri = URI(uri)
+ uri.password = 'REDACTED' if uri.password
+ @uri = uri.to_s
+ rescue URI::InvalidURIError, ArgumentError
+ @uri = uri
+ end
end
def to_s # :nodoc: