Skip to content
Snippets Groups Projects
Commit 05d9622c authored by Xu Cheng's avatar Xu Cheng
Browse files

download_strategy: don't check url if already downloaded


Closes Homebrew/homebrew#40859.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent 7c83e3ff
No related branches found
No related tags found
No related merge requests found
......@@ -270,16 +270,16 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
def fetch
ohai "Downloading #{@url}"
urls = actual_urls
unless urls.empty?
ohai "Downloading from: #{urls.last}"
if !ENV["HOMEBREW_NO_INSECURE_REDIRECT"].nil? && @url.start_with?("https://") &&
urls.any? { |u| !u.start_with? "https://" }
raise "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set."
unless cached_location.exist?
urls = actual_urls
unless urls.empty?
ohai "Downloading from: #{urls.last}"
if !ENV["HOMEBREW_NO_INSECURE_REDIRECT"].nil? && @url.start_with?("https://") &&
urls.any? { |u| !u.start_with? "https://" }
raise "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set."
end
end
end
unless cached_location.exist?
had_incomplete_download = temporary_path.exist?
begin
_fetch
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment