aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXu Cheng2015-08-17 18:50:00 +0800
committerXu Cheng2015-08-18 15:55:36 +0800
commit4d84ff3b03b6d0f76cc249ebe9cf8ce9722dc09a (patch)
tree24261444ec3feb49a04fb1dbfa3e46e59a5aeb5e
parent8ba0fb9fcf0d4d4d3497cf524b4c21c6fd4a86e3 (diff)
downloadbrew-4d84ff3b03b6d0f76cc249ebe9cf8ce9722dc09a.tar.bz2
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>
-rw-r--r--Library/Homebrew/download_strategy.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb
index 5243a7536..3d70324b1 100644
--- a/Library/Homebrew/download_strategy.rb
+++ b/Library/Homebrew/download_strategy.rb
@@ -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