[rubygems/rubygems] Modify invalid key check to accept keys with colons

https://github.com/rubygems/rubygems/commit/413033198b

Co-authored-by: Eric Herscovich <eric.herscovich@shopify.com>
This commit is contained in:
Jenny Shen 2023-05-16 14:26:03 -04:00 committed by git
parent 92d6c9a7b1
commit e854b050cc

View File

@ -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.to_s.gsub(%r{https?:\/\/}, "").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