Merge pull request #20392 from jrouly/jrouly/content-type-patch

handle false content_type
This commit is contained in:
Mike McQuaid 2025-08-07 08:12:12 +00:00 committed by GitHub
commit ad48b5a5f5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -468,7 +468,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
# The cached location is no longer fresh if either:
# - Last-Modified value is newer than the file's timestamp
# - 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
ohai "Ignoring #{cached_location}",
"Cached modified time #{cached_location.mtime.iso8601} is before" \