Skip to content

Commit

Permalink
Merge pull request #16079 from Bo98/mirror-fix
Browse files Browse the repository at this point in the history
download_strategy: fix mirrors not working
  • Loading branch information
MikeMcQuaid committed Oct 4, 2023
2 parents 75b18b5 + 9c16089 commit 13b01a6
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 @@ -488,7 +488,12 @@ def resolve_url_basename_time_file_size(url, timeout: nil)
@resolved_info_cache ||= {}
return @resolved_info_cache[url] if @resolved_info_cache.include?(url)

parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout: timeout)
begin
parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout: timeout)
rescue ErrorDuringExecution
return [url, parse_basename(url), nil, nil, false]
end

parsed_headers = parsed_output.fetch(:responses).map { |r| r.fetch(:headers) }

final_url = curl_response_follow_redirections(parsed_output.fetch(:responses), url)
Expand Down

0 comments on commit 13b01a6

Please sign in to comment.