mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -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']}
|
* Follow HTTP redirection: #{response['Location']}
|
||||||
*
|
*
|
||||||
EOT
|
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
|
else
|
||||||
abort "Download failed with error #{response.code}: #{response.msg}".lightred
|
abort "Download failed with error #{response.code}: #{response.msg}".lightred
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user