From 03a72760ef8a7b3c04193ed51fa5398d38abbd96 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Tue, 5 Oct 2021 13:24:29 +0100 Subject: [PATCH] utils/curl: add comment detailing options handling --- Library/Homebrew/utils/curl.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 1bfb499727..6a3a1d74aa 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -304,6 +304,8 @@ module Utils ) file = Tempfile.new.tap(&:close) + # Convert specs to options. This is mostly key-value options, + # unless the value is a boolean in which case treat as as flag. specs = specs.flat_map do |option, argument| next [] if argument == false # No flag. @@ -311,6 +313,7 @@ module Utils 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,