pull: fix polling code for Ruby 1.8.7 Net::HTTP (#191)

This commit is contained in:
Andrew Janke 2016-05-03 10:30:01 -04:00
parent 70096f8e91
commit bf23ba1d1e

View File

@ -518,9 +518,11 @@ module Homebrew
# 401 error is normal while file is still in async publishing process
url = URI(bottle_info.url)
puts "Verifying bottle: #{File.basename(url.path)}"
Net::HTTP.start(url.host, url.port, :use_ssl => true) do |http|
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.start do
while true do
req = Net::HTTP::Head.new url
req = Net::HTTP::Head.new bottle_info.url
res = http.request req
retry_count += 1
if res.is_a?(Net::HTTPSuccess)