livecheck/strategy: verify fail-with-body support
This commit is contained in:
parent
c5fba877c6
commit
07e69b0ff2
@ -219,7 +219,7 @@ module Homebrew
|
||||
stdout, stderr, status = curl_output(
|
||||
*PAGE_CONTENT_CURL_ARGS, url,
|
||||
**DEFAULT_CURL_OPTIONS,
|
||||
use_homebrew_curl: homebrew_curl,
|
||||
use_homebrew_curl: homebrew_curl || !curl_supports_fail_with_body?,
|
||||
user_agent:
|
||||
)
|
||||
next unless status.success?
|
||||
|
||||
@ -470,6 +470,13 @@ module Utils
|
||||
T.must(file).unlink
|
||||
end
|
||||
|
||||
def curl_supports_fail_with_body?
|
||||
@curl_supports_fail_with_body ||= Hash.new do |h, key|
|
||||
h[key] = Version.new(curl_output("-V").stdout[/curl (\d+(\.\d+)+)/, 1]) >= Version.new("7.76.0")
|
||||
end
|
||||
@curl_supports_fail_with_body[curl_path]
|
||||
end
|
||||
|
||||
def curl_supports_tls13?
|
||||
@curl_supports_tls13 ||= Hash.new do |h, key|
|
||||
h[key] = quiet_system(curl_executable, "--tlsv1.3", "--head", "https://brew.sh/")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user