download_strategy: move HOMEBREW_ARTIFACT_DOMAIN hack
This commit is contained in:
parent
77a4e2e82a
commit
c969be340e
@ -383,7 +383,6 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
attr_reader :mirrors
|
||||
|
||||
def initialize(url, name, version, **meta)
|
||||
super
|
||||
@try_partial = true
|
||||
@mirrors = meta.fetch(:mirrors, [])
|
||||
|
||||
@ -410,6 +409,10 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
begin
|
||||
url = urls.shift
|
||||
|
||||
if (domain = Homebrew::EnvConfig.artifact_domain)
|
||||
url = url.sub(%r{^https?://#{GitHubPackages::URL_DOMAIN}/}o, "#{domain.chomp("/")}/")
|
||||
end
|
||||
|
||||
ohai "Downloading #{url}"
|
||||
|
||||
use_cached_location = cached_location.exist?
|
||||
@ -477,10 +480,6 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
|
||||
@resolved_info_cache ||= {}
|
||||
return @resolved_info_cache[url] if @resolved_info_cache.include?(url)
|
||||
|
||||
if (domain = Homebrew::EnvConfig.artifact_domain)
|
||||
url = url.sub(%r{^https?://#{GitHubPackages::URL_DOMAIN}/}o, "#{domain.chomp("/")}/")
|
||||
end
|
||||
|
||||
parsed_output = curl_headers(url.to_s, wanted_headers: ["content-disposition"], timeout: timeout)
|
||||
parsed_headers = parsed_output.fetch(:responses).map { |r| r.fetch(:headers) }
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user