From 56ccf10efaac5f97bae6b2e5aef9ef87d7529328 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 29 Aug 2017 12:53:45 +0000 Subject: limit some heuristics to strict mode --- Library/Homebrew/dev-cmd/audit.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 5a86c0adf..17948ea2c 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -201,7 +201,7 @@ class FormulaAuditor @specs = %w[stable devel head].map { |s| formula.send(s) }.compact end - def self.check_http_content(url, name, user_agents: [:default], check_content: false) + def self.check_http_content(url, name, user_agents: [:default], check_content: false, strict: false) return unless url.start_with? "http" details = nil @@ -251,6 +251,8 @@ class FormulaAuditor return "The URL #{url} should use HTTPS rather than HTTP" end + return unless strict + # Same size, different content after normalization # (typical causes: Generated ID, Timestamp, Unix time) if details[:file].length == secure_details[:file].length @@ -590,7 +592,8 @@ class FormulaAuditor if http_content_problem = FormulaAuditor.check_http_content(homepage, formula.name, user_agents: [:browser, :default], - check_content: true) + check_content: true, + strict: @strict) problem http_content_problem end end -- cgit v1.2.3