Merge pull request #19564 from Homebrew/cache-ignore-zero-size

download_strategy: ignore Content-Length value if zero
This commit is contained in:
Eric Knibbe 2025-03-21 00:22:54 +00:00 committed by GitHub
commit 630c1fe90e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -488,7 +488,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy
# - Content-Length value is different than the file's size
cached_location_valid = if cached_location_valid
newer_last_modified = last_modified && last_modified > cached_location.mtime
different_file_size = file_size && file_size != cached_location.size
different_file_size = file_size&.nonzero? && file_size != cached_location.size
!(newer_last_modified || different_file_size)
end