lib/cc/cli/version_checker.rb in codeclimate-0.63.3 vs lib/cc/cli/version_checker.rb in codeclimate-0.63.4
- old
+ new
@@ -64,11 +64,10 @@
@http_response ||=
begin
uri = URI.parse(ENV.fetch("CODECLIMATE_VERSIONS_URL", DEFAULT_VERSIONS_URL))
uri.query = { version: version, uid: global_config.uuid }.to_query
- request = Net::HTTP::Get.new(uri)
- request["User-Agent"] = user_agent
+ request = Net::HTTP::Get.new(uri, "User-Agent" => user_agent)
Net::HTTP.start(uri.host, uri.port, open_timeout: 5, read_timeout: 5, ssl_timeout: 5, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
end