Skip to content

Commit a27f303

Browse files
hsbtclaude
authored andcommitted
[ruby/rubygems] Normalize host comparison in attestation_supported_host?
The method compared against a hardcoded string, so a trailing slash (e.g. "https://rubygems.org/") would cause auto-attestation to be silently skipped. Now we chomp the trailing slash and compare against Gem::DEFAULT_HOST to be consistent with the rest of the codebase. ruby/rubygems@a4fa24c8cf Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b9358e9 commit a27f303

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/rubygems/commands/push_command.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def get_push_scope
179179
end
180180

181181
def attestation_supported_host?
182-
(@host || Gem.host) == "https://rubygems.org"
182+
host = (@host || Gem.host).to_s.chomp("/")
183+
host == Gem::DEFAULT_HOST
183184
end
184185
end

0 commit comments

Comments
 (0)