summaryrefslogtreecommitdiff
path: root/lib/rubygems
diff options
context:
space:
mode:
authorDaniel Niknam <mhmd.niknam@gmail.com>2021-08-22 01:33:21 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-08-31 19:06:14 +0900
commit31c2e6c08eccf77ec24126b9c77a910a4e543293 (patch)
tree6f732471f7b5bf27a2de763b4802859b9f481ea0 /lib/rubygems
parentb41802421ac7e790a98ed59be67631687fc5808f (diff)
[rubygems/rubygems] Using `Gem::PrintableUri` in `Gem::Commands::InstallCommand` class
The `x.source.uri` could be a source URI with a credential. Using `Gem::PrintableUri` to make sure we are redacting sensitive information from it. https://github.com/rubygems/rubygems/commit/8755ee0aaa
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4789
Diffstat (limited to 'lib/rubygems')
-rw-r--r--lib/rubygems/commands/install_command.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rubygems/commands/install_command.rb b/lib/rubygems/commands/install_command.rb
index 92430ea444..ee50cba472 100644
--- a/lib/rubygems/commands/install_command.rb
+++ b/lib/rubygems/commands/install_command.rb
@@ -5,6 +5,7 @@ require_relative '../dependency_installer'
require_relative '../local_remote_options'
require_relative '../validator'
require_relative '../version_option'
+require_relative '../printable_uri'
##
# Gem installer command line tool
@@ -260,7 +261,8 @@ You can use `i` command instead of `install`.
errors.each do |x|
return unless Gem::SourceFetchProblem === x
- msg = "Unable to pull data from '#{x.source.uri}': #{x.error.message}"
+ printable_uri = Gem::PrintableUri.parse_uri(x.source.uri.clone)
+ msg = "Unable to pull data from '#{printable_uri}': #{x.error.message}"
alert_warning msg
end