Skip to content

Commit ad48b5a

Browse files
authored
Merge pull request #20392 from jrouly/jrouly/content-type-patch
handle false content_type
2 parents 9f52a57 + 0270bd9 commit ad48b5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Library/Homebrew/download_strategy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ def fetch(timeout: nil)
468468
# The cached location is no longer fresh if either:
469469
# - Last-Modified value is newer than the file's timestamp
470470
# - Content-Length value is different than the file's size
471-
if cached_location_valid && (content_type.nil? || !content_type.start_with?("text/"))
471+
if cached_location_valid && (!content_type.is_a?(String) || !content_type.start_with?("text/"))
472472
if last_modified && last_modified > cached_location.mtime
473473
ohai "Ignoring #{cached_location}",
474474
"Cached modified time #{cached_location.mtime.iso8601} is before" \

0 commit comments

Comments
 (0)