diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index ee7ba58db1..89a79c6e0b 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -336,7 +336,10 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy .compact redirect_url = locations.reduce(url) do |current_url, location| - if location.start_with?("/") + if location.start_with?("//") + uri = URI(current_url) + "#{uri.scheme}:#{location}" + elsif location.start_with?("/") uri = URI(current_url) "#{uri.scheme}://#{uri.host}#{location}" else