From d8d1922fec5ff0e5a49198ecec2f6f0bee7c38c2 Mon Sep 17 00:00:00 2001 From: yahavi Date: Tue, 27 Jul 2021 16:16:18 +0300 Subject: [PATCH] Error raised when no headers defined in curl download --- Library/Homebrew/download_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 0ee946872b..210521c5ec 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -391,7 +391,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy resolved_url, _, url_time, _, is_redirection = resolve_url_basename_time_file_size(url, timeout: end_time&.remaining!) # Authorization is no longer valid after redirects - meta[:headers].delete_if { |header| header.first&.start_with?("Authorization") } if is_redirection + meta[:headers]&.delete_if { |header| header.first&.start_with?("Authorization") } if is_redirection fresh = if cached_location.exist? && url_time url_time <= cached_location.mtime