From 2a9540b3ab2c5662cca5eea8e991bba528635d3a Mon Sep 17 00:00:00 2001 From: Connor Mann <34930543+cnnrmnn@users.noreply.github.com> Date: Fri, 14 May 2021 15:16:37 -0400 Subject: [PATCH] Check for key explicitly with `key?` Co-authored-by: Rylan Polster --- Library/Homebrew/utils/curl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 5578d29711..cb38e9e7d6 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -138,7 +138,7 @@ module Utils # Any value for `accept-ranges` other than none indicates that the server supports partial requests. # Its absence indicates no support. - supports_partial = headers["accept-ranges"] && headers["accept-ranges"] != "none" + supports_partial = headers.key? "accept-ranges" && headers["accept-ranges"] != "none" if supports_partial && destination.exist? &&