summaryrefslogtreecommitdiff
path: root/lib/rubygems/gemcutter_utilities.rb
diff options
context:
space:
mode:
authorDavid Rodríguez <[email protected]>2024-01-15 20:51:02 +0100
committerHiroshi SHIBATA <[email protected]>2024-01-29 12:14:21 +0900
commitd64d0b54231208c7bec899a7fe8c3b98ec2e9a1b ()
tree9d18dbdda185bda6ccaf1f5a710f678dddbc907f /lib/rubygems/gemcutter_utilities.rb
parent6bbbfb4629a4fdb336d5ac4f625e97ce30c15a01 (diff)
Vendor uri gem in RubyGems
-rw-r--r--lib/rubygems/gemcutter_utilities.rb10
1 files changed, 5 insertions, 5 deletions
@@ -93,8 +93,8 @@ module Gem::GemcutterUtilities
end
if allowed_push_host
- allowed_host_uri = URI.parse(allowed_push_host)
- host_uri = URI.parse(self.host)
unless (host_uri.scheme == allowed_host_uri.scheme) && (host_uri.host == allowed_host_uri.host)
alert_error "#{self.host.inspect} is not allowed by the gemspec, which only allows #{allowed_push_host.inspect}"
@@ -102,7 +102,7 @@ module Gem::GemcutterUtilities
end
end
- uri = URI.parse "#{self.host}/#{path}"
response = request_with_otp(method, uri, &block)
if mfa_unauthorized?(response)
@@ -136,7 +136,7 @@ module Gem::GemcutterUtilities
sign_in_host, scope: scope) do |request|
request.basic_auth email, password
request["OTP"] = otp if otp
- request.body = URI.encode_www_form({ api_key: api_key }.merge(update_scope_params))
end
with_response response do |_resp|
@@ -176,7 +176,7 @@ module Gem::GemcutterUtilities
sign_in_host, credentials: credentials, scope: scope) do |request|
request.basic_auth email, password
request["OTP"] = otp if otp
- request.body = URI.encode_www_form({ name: key_name }.merge(all_params))
end
with_response response do |resp|