diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 97eb98373d..37a4f71e4f 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -304,7 +304,13 @@ module Utils ) file = Tempfile.new.tap(&:close) - specs = specs.flat_map { |option, argument| ["--#{option.to_s.tr("_", "-")}", argument] } + specs = specs.flat_map do |option, argument| + next if argument == false # No flag. + + args = ["--#{option.to_s.tr("_", "-")}"] + args << argument unless argument == true # It's a flag. + args + end max_time = hash_needed ? 600 : 25 output, _, status = curl_output( *specs, "--dump-header", "-", "--output", file.path, "--location", url,