diff options
author | Ashley Ellis Pierce <anellis12@gmail.com> | 2022-01-24 17:09:25 -0500 |
---|---|---|
committer | git <svn-admin@ruby-lang.org> | 2022-04-06 08:54:56 +0900 |
commit | 925d73b3eec1aa213173c24c3b784bbb7debe79e (patch) | |
tree | c08b2827c86cdc437ddc7e22135adc1ecd5a174e /lib/rubygems | |
parent | 8650811bc04d0f037a634e594501154106e6aec9 (diff) | |
download | ruby-925d73b3eec1aa213173c24c3b784bbb7debe79e.tar.gz |
[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
Diffstat (limited to 'lib/rubygems')
-rw-r--r-- | lib/rubygems/gemcutter_utilities.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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| |