From aa989bd55a2013c9858e19455c700b707d65021e Mon Sep 17 00:00:00 2001 From: cnnrmnn Date: Thu, 13 May 2021 11:39:59 -0400 Subject: [PATCH] Change inititial partial request to HEAD request --- Library/Homebrew/utils/curl.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index eafc5ae81f..67a5630747 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -118,15 +118,15 @@ module Utils result end - def curl_download(*args, to: nil, partial: true, **options) + def curl_download(*args, to: nil, try_partial: true, **options) destination = Pathname(to) destination.dirname.mkpath - if partial + if try_partial range_stdout = curl_output("--location", "--range", "0-1", "--dump-header", "-", "--write-out", "%\{http_code}", - "--output", "/dev/null", *args, **options).stdout + "--head", *args, **options).stdout headers, _, http_status = range_stdout.partition("\r\n\r\n") supports_partial_download = http_status.to_i == 206 # Partial Content