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