From 97b66d3ae76ab85a83fc233fe24f0fb27722812e Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Wed, 8 Mar 2023 12:49:25 +0000 Subject: [PATCH] download_strategy: add another presence check. --- 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 7964497a79..ce63bd7460 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -487,7 +487,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy # content-disposition: attachment; filename="myapp-1.2.3.pkg"; filename*=UTF-8''"myapp-1.2.3.pkg" # Then the encoded_filename will come back as the empty string, in which case we should fall back to the # `filename` parameter. - if encoding && encoded_filename.present? + if encoding.present? && encoded_filename.present? filename = URI.decode_www_form_component(encoded_filename).encode(encoding) end end