aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorViktor Szakats2017-08-29 12:53:45 +0000
committerViktor Szakats2017-08-29 12:53:45 +0000
commit56ccf10efaac5f97bae6b2e5aef9ef87d7529328 (patch)
treec81a46054f4b3eb4e40d8dd0e0459c418cadd2c6 /Library/Homebrew/dev-cmd
parentc30b94135853b809eda34c5c347c549bbf08a42d (diff)
downloadbrew-56ccf10efaac5f97bae6b2e5aef9ef87d7529328.tar.bz2
limit some heuristics to strict mode
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb7
1 files 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