From a82a8efce9828e33f0a032689288838cbb5c7c7d Mon Sep 17 00:00:00 2001 From: Eric Knibbe Date: Thu, 20 Mar 2025 15:29:42 -0400 Subject: [PATCH] download_strategy: ignore Content-Length value if zero --- Library/Homebrew/download_strategy.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 58a79b181f..75887d3434 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -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