diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-05 03:32:58 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-03-05 03:32:58 +0000 |
commit | 08f8cfe14e0f8937e3bcf8a22becdc5ce60b920e (patch) | |
tree | 30977064b5f93f9ac5b01b2a676f6d6ffdcec652 /lib/rubygems/commands/push_command.rb | |
parent | 593505ac6f802d2b5bff469425b7c76b65cc9b10 (diff) | |
download | ruby-08f8cfe14e0f8937e3bcf8a22becdc5ce60b920e.tar.gz |
Merge RubyGems upstream: 56c0bbb69e4506bda7ef7f447dfec5db820df20b
It fixed the multiple vulnerabilities.
https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/push_command.rb')
-rw-r--r-- | lib/rubygems/commands/push_command.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb index 7fd1119ff9..41e6c7ec30 100644 --- a/lib/rubygems/commands/push_command.rb +++ b/lib/rubygems/commands/push_command.rb @@ -119,22 +119,18 @@ You can upgrade or downgrade to the latest release version with: response = send_push_request(name, args) - if need_otp? response - response = send_push_request(name, args, true) - end - with_response response end private - def send_push_request(name, args, use_otp = false) + def send_push_request(name, args) rubygems_api_request(*args) do |request| request.body = Gem.read_binary name request.add_field "Content-Length", request.body.size request.add_field "Content-Type", "application/octet-stream" request.add_field "Authorization", api_key - request.add_field "OTP", options[:otp] if use_otp + request.add_field "OTP", options[:otp] if options[:otp] end end |