create: fix archive check if HTML starts with spaces

This commit is contained in:
Anatoli Babenia 2025-05-30 06:44:02 +03:00
parent e6377ed0c1
commit d860fa1fa8

View File

@ -84,7 +84,7 @@ module Homebrew
r.owner = self
filepath = r.fetch
html_doctype_prefix = "<!doctype html"
if File.read(filepath, html_doctype_prefix.length).downcase.start_with?(html_doctype_prefix)
if File.read(filepath, 100).strip.downcase.start_with?(html_doctype_prefix)
raise "Downloaded URL is not archive"
end