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

download_strategy: fix url reassign

We need reassign url after urls are inspected.
parent b18015a7
No related branches found
No related tags found
No related merge requests found
......@@ -274,11 +274,11 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
urls = actual_urls
unless urls.empty?
ohai "Downloading from #{urls.last}"
@url = 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
@url = urls.last
end
had_incomplete_download = temporary_path.exist?
......
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