Skip to content

Commit 630c1fe

Browse files
Merge pull request #19564 from Homebrew/cache-ignore-zero-size
download_strategy: ignore Content-Length value if zero
2 parents aaf1258 + a82a8ef commit 630c1fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Library/Homebrew/download_strategy.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def fetch(timeout: nil)
488488
# - Content-Length value is different than the file's size
489489
cached_location_valid = if cached_location_valid
490490
newer_last_modified = last_modified && last_modified > cached_location.mtime
491-
different_file_size = file_size && file_size != cached_location.size
491+
different_file_size = file_size&.nonzero? && file_size != cached_location.size
492492
!(newer_last_modified || different_file_size)
493493
end
494494

0 commit comments

Comments
 (0)