lib/cc/cli/prepare.rb in codeclimate-0.70.6 vs lib/cc/cli/prepare.rb in codeclimate-0.71.0
- old
+ new
@@ -56,10 +56,12 @@
def fetch(url, target_path)
ensure_external!(url) unless allow_internal_ips?
uri = URI.parse(url)
- resp = Net::HTTP.get_response(uri)
+ http = Net::HTTP.new(uri.host, uri.port)
+ http.use_ssl = uri.scheme == "https"
+ resp = http.get(uri)
if resp.code == "200"
write_file(target_path, resp.body)
say("Wrote #{url} to #{target_path}")
else
raise FetchError, "Failed fetching #{url}: code=#{resp.code} body=#{resp.body}"