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: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
8ba0fb9fcf
commit
4d84ff3b03
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user