handle false content_type

This commit is contained in:
Michel Rouly 2025-08-06 11:45:53 -07:00
parent 726f83c4a8
commit 0270bd9d2a

View File

@ -468,7 +468,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
# The cached location is no longer fresh if either: # The cached location is no longer fresh if either:
# - Last-Modified value is newer than the file's timestamp # - Last-Modified value is newer than the file's timestamp
# - Content-Length value is different than the file's size # - Content-Length value is different than the file's size
if cached_location_valid && (content_type.nil? || !content_type.start_with?("text/")) if cached_location_valid && (!content_type.is_a?(String) || !content_type.start_with?("text/"))
if last_modified && last_modified > cached_location.mtime if last_modified && last_modified > cached_location.mtime
ohai "Ignoring #{cached_location}", ohai "Ignoring #{cached_location}",
"Cached modified time #{cached_location.mtime.iso8601} is before" \ "Cached modified time #{cached_location.mtime.iso8601} is before" \