Skip to content
Snippets Groups Projects
Unverified Commit 83b774d6 authored by Markus Reiter's avatar Markus Reiter Committed by GitHub
Browse files

Merge pull request #9436 from reitermarkus/audit-appcast

Reuse `curl_http_content_headers_and_checksum` for appcast audit.
parents 7ed73196 9e0a54fd
No related branches found
No related tags found
No related merge requests found
......@@ -515,12 +515,12 @@ module Cask
return if cask.appcast.to_s.empty?
return if cask.appcast.must_contain == :no_check
appcast_stanza = cask.appcast.to_s
appcast_contents, = begin
curl_output("--compressed", "--user-agent", HOMEBREW_USER_AGENT_FAKE_SAFARI, "--location",
"--globoff", "--max-time", "5", appcast_stanza)
appcast_url = cask.appcast.to_s
begin
details = curl_http_content_headers_and_checksum(appcast_url, user_agent: HOMEBREW_USER_AGENT_FAKE_SAFARI)
appcast_contents = details[:file]
rescue
add_error "appcast at URL '#{appcast_stanza}' offline or looping"
add_error "appcast at URL '#{appcast_url}' offline or looping"
return
end
......@@ -528,7 +528,7 @@ module Cask
adjusted_version_stanza = cask.appcast.must_contain.presence || version_stanza.match(/^[[:alnum:].]+/)[0]
return if appcast_contents.include? adjusted_version_stanza
add_error "appcast at URL '#{appcast_stanza}' does not contain"\
add_error "appcast at URL '#{appcast_url}' does not contain"\
" the version number '#{adjusted_version_stanza}':\n#{appcast_contents}"
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment