diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 1261e1e1a6..3e9438ec0e 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -348,7 +348,7 @@ if you believe they were disclosed to a third party. begin config = self.class.load_with_rubygems_config_hash(File.read(filename)) - if config.keys.any? { |k| k.include?(":") } + if config.keys.any? { |k| k.to_s.gsub(%r{https?:\/\/}, "").include?(":") } warn "Failed to load #{filename} because it doesn't contain valid YAML hash" return {} else