From bbfa52fcaa582a182a967651c934e6e5e97f6a22 Mon Sep 17 00:00:00 2001 From: Michka Popoff Date: Fri, 20 Aug 2021 10:14:50 +0200 Subject: [PATCH] formula_auditor: use brewed curl for homepage check when needed If the download url is using brewed curl, use that too for the homepage check. Ideally one would introduce the "using: :homebrew_curl" stanza for the homepage line in the DSL, but it is easier to implicitely use the same logic for homepages and url's and define the "using:" only once. --- Library/Homebrew/formula_auditor.rb | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 277f2fdf4a..1f5483c97e 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -412,11 +412,21 @@ module Homebrew return unless DevelopmentTools.curl_handles_most_https_certificates? + use_homebrew_curl = false + %w[Stable HEAD].each do |name| + spec_name = name.downcase.to_sym + next unless (spec = formula.send(spec_name)) + + use_homebrew_curl = spec.using == :homebrew_curl + break if use_homebrew_curl + end + if (http_content_problem = curl_check_http_content(homepage, "homepage URL", - user_agents: [:browser, :default], - check_content: true, - strict: @strict)) + user_agents: [:browser, :default], + check_content: true, + strict: @strict, + use_homebrew_curl: use_homebrew_curl)) problem http_content_problem end end