Merge pull request #17356 from Homebrew/verify-fail-with-body
livecheck/strategy: verify `--fail-with-body` support
This commit is contained in:
commit
ea5023a4ad
@ -219,7 +219,7 @@ module Homebrew
|
|||||||
stdout, stderr, status = curl_output(
|
stdout, stderr, status = curl_output(
|
||||||
*PAGE_CONTENT_CURL_ARGS, url,
|
*PAGE_CONTENT_CURL_ARGS, url,
|
||||||
**DEFAULT_CURL_OPTIONS,
|
**DEFAULT_CURL_OPTIONS,
|
||||||
use_homebrew_curl: homebrew_curl,
|
use_homebrew_curl: homebrew_curl || !curl_supports_fail_with_body?,
|
||||||
user_agent:
|
user_agent:
|
||||||
)
|
)
|
||||||
next unless status.success?
|
next unless status.success?
|
||||||
|
|||||||
@ -470,6 +470,13 @@ module Utils
|
|||||||
T.must(file).unlink
|
T.must(file).unlink
|
||||||
end
|
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?
|
def curl_supports_tls13?
|
||||||
@curl_supports_tls13 ||= Hash.new do |h, key|
|
@curl_supports_tls13 ||= Hash.new do |h, key|
|
||||||
h[key] = quiet_system(curl_executable, "--tlsv1.3", "--head", "https://brew.sh/")
|
h[key] = quiet_system(curl_executable, "--tlsv1.3", "--head", "https://brew.sh/")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user