mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-08 23:18:10 -05:00
Update downloader.rb (#6736)
This commit is contained in:
@@ -66,7 +66,12 @@ def downloader (url, filename = File.basename(url), retry_count = 0, verbose = f
|
||||
* Follow HTTP redirection: #{response['Location']}
|
||||
*
|
||||
EOT
|
||||
return downloader(response['Location'], filename, retry_count, verbose)
|
||||
|
||||
redirect_uri = URI(response['Location'])
|
||||
redirect_uri.scheme ||= uri.scheme
|
||||
redirect_uri.host ||= uri.host
|
||||
|
||||
return downloader(redirect_uri.to_s, filename, retry_count, verbose)
|
||||
else
|
||||
abort "Download failed with error #{response.code}: #{response.msg}".lightred
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user