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

allowing rescue https redirect error


It can be useful when implementing custom https mirror strategy such as Homebrew/homebrew#42955.

Closes Homebrew/homebrew#43020.

Signed-off-by: default avatarXu Cheng <xucheng@me.com>
parent 8ba0fb9f
No related branches found
No related tags found
No related merge requests found
......@@ -276,7 +276,8 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
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."
puts "HTTPS to HTTP redirect detected & HOMEBREW_NO_INSECURE_REDIRECT is set."
raise CurlDownloadStrategyError.new(@url)
end
@url = urls.last
end
......
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