fixes #2491
This commit is contained in:
@@ -14,16 +14,21 @@ module Downloads
|
||||
end
|
||||
|
||||
protected
|
||||
def http_exists?(url, headers)
|
||||
exists = false
|
||||
def http_head_request(url, headers)
|
||||
uri = URI.parse(url)
|
||||
Net::HTTP.start(uri.host, uri.port) do |http|
|
||||
http.request_head(uri.request_uri, headers) do |res|
|
||||
if res.is_a?(Net::HTTPSuccess)
|
||||
exists = true
|
||||
end
|
||||
return res
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def http_exists?(url, headers)
|
||||
exists = false
|
||||
res = http_head_request(url, headers)
|
||||
if res.is_a?(Net::HTTPSuccess)
|
||||
exists = true
|
||||
end
|
||||
exists
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user