limit some heuristics to strict mode
This commit is contained in:
parent
c30b941358
commit
56ccf10efa
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user