download_strategy: fix mirrors not working

This commit is contained in:
Bo Anderson 2023-10-04 14:28:52 +01:00
parent f61e4ee872
commit 9c16089e95
No known key found for this signature in database
GPG Key ID: 3DB94E204E137D65

View File

@ -488,7 +488,12 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
@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)