From 71759035dd82b40b7ad8a4a1f30e917b4306e6c8 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Tue, 15 Dec 2020 20:30:56 +0100 Subject: [PATCH] Fix Sparkle detection if content type is missing. --- Library/Homebrew/livecheck/strategy/sparkle.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/livecheck/strategy/sparkle.rb b/Library/Homebrew/livecheck/strategy/sparkle.rb index 7822bb73ac..b37b41ce4b 100644 --- a/Library/Homebrew/livecheck/strategy/sparkle.rb +++ b/Library/Homebrew/livecheck/strategy/sparkle.rb @@ -26,8 +26,8 @@ module Homebrew xml = url.end_with?(".xml") xml ||= begin headers = Strategy.page_headers(url) - content_type = headers["content-type"]&.split(";", 2)&.first - ["application/xml", "text/xml"].include?(content_type) + content_type = headers["content-type"] + content_type.blank? || content_type.include?("xml") end return false unless xml