From 925d73b3eec1aa213173c24c3b784bbb7debe79e Mon Sep 17 00:00:00 2001 From: Ashley Ellis Pierce Date: Mon, 24 Jan 2022 17:09:25 -0500 Subject: [rubygems/rubygems] Make changes <2.6 compatible Multiple params to merge was not introduced until Ruby 2.6, so this merges the two additional params together first and then merges that with the request body https://github.com/rubygems/rubygems/commit/870f7e9a1c --- lib/rubygems/gemcutter_utilities.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb index 3f111c628e..9fd788793c 100644 --- a/lib/rubygems/gemcutter_utilities.rb +++ b/lib/rubygems/gemcutter_utilities.rb @@ -165,12 +165,14 @@ module Gem::GemcutterUtilities key_name = get_key_name(scope) scope_params = get_scope_params(scope) mfa_params = get_mfa_params(email, password) + all_params = scope_params.merge(mfa_params) + response = rubygems_api_request(:post, "api/v1/api_key", sign_in_host, scope: scope) do |request| request.basic_auth email, password request["OTP"] = otp if otp - request.body = URI.encode_www_form({ name: key_name }.merge(scope_params, mfa_params)) + request.body = URI.encode_www_form({ name: key_name }.merge(all_params)) end with_response response do |resp| -- cgit v1.2.3