mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Cask: recover Git-Jiro's old audit work
This commit is contained in:
parent
17154abf46
commit
3acebc5b62
@ -1,6 +1,7 @@
|
|||||||
require "cask/checkable"
|
require "cask/checkable"
|
||||||
require "cask/download"
|
require "cask/download"
|
||||||
require "digest"
|
require "digest"
|
||||||
|
require "utils/curl"
|
||||||
require "utils/git"
|
require "utils/git"
|
||||||
|
|
||||||
module Cask
|
module Cask
|
||||||
@ -30,6 +31,7 @@ module Cask
|
|||||||
check_generic_artifacts
|
check_generic_artifacts
|
||||||
check_token_conflicts
|
check_token_conflicts
|
||||||
check_download
|
check_download
|
||||||
|
check_https_availability
|
||||||
check_single_pre_postflight
|
check_single_pre_postflight
|
||||||
check_single_uninstall_zap
|
check_single_uninstall_zap
|
||||||
check_untrusted_pkg
|
check_untrusted_pkg
|
||||||
@ -317,5 +319,16 @@ module Cask
|
|||||||
rescue => e
|
rescue => e
|
||||||
add_error "download not possible: #{e.message}"
|
add_error "download not possible: #{e.message}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_https_availability
|
||||||
|
check_url_for_https_availability(cask.url, user_agents: [cask.url.user_agent]) unless cask.url.to_s.empty?
|
||||||
|
check_url_for_https_availability(cask.appcast) unless cask.appcast.to_s.empty?
|
||||||
|
check_url_for_https_availability(cask.homepage) unless cask.homepage.to_s.empty?
|
||||||
|
end
|
||||||
|
|
||||||
|
def check_url_for_https_availability(url_to_check, user_agents: [:default])
|
||||||
|
problem = curl_check_http_content(url_to_check.to_s, user_agents: user_agents)
|
||||||
|
add_error problem unless problem.nil?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user