Skip to content

Commit

Permalink
[rubygems/rubygems] Suppress Content-Type warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nobu authored and matzbot committed Jun 19, 2023
1 parent 512cac3 commit 11ee4f2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/rubygems/utilities.rb
Expand Up @@ -214,8 +214,9 @@ def self.get(uri)
end
end

def self.post(uri)
post = Net::HTTP::Post.new(uri)
def self.post(uri, content_type: "application/x-www-form-urlencoded")
headers = { "content-type" => content_type } if content_type
post = Net::HTTP::Post.new(uri, headers)
Net::HTTP.start(uri.hostname, uri.port) do |http|
http.request(post)
end
Expand Down

0 comments on commit 11ee4f2

Please sign in to comment.