Skip to content

Commit

Permalink
download_strategy: try original url with cookie jar if redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
FnControlOption committed Jul 29, 2021
1 parent 5ee14d4 commit 08ba1e4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Library/Homebrew/download_strategy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,12 @@ def fetch(timeout: nil)
else
begin
_fetch(url: url, resolved_url: resolved_url, timeout: end_time&.remaining!)
rescue ErrorDuringExecution
rescue ErrorDuringExecution => e
if e.status.exitstatus == 22 && resolved_url != url && is_redirection
ohai "Downloading from #{url}"
resolved_url = url
retry
end
raise CurlDownloadStrategyError, url
end
ignore_interrupts do
Expand Down

0 comments on commit 08ba1e4

Please sign in to comment.