From 6e603c2859bb1eac1c09b4334965c1ce4f1beba1 Mon Sep 17 00:00:00 2001 From: Sam Hathaway Date: Tue, 18 Dec 2018 11:35:25 -0500 Subject: [PATCH] Use GET rather than HEAD when checking for range support in curl_download. * Some HTTP servers apparently support ranges but don't support HEAD. * This is a more realistic check anyway since the actual download request will use GET (not HEAD). * This fixes Homebrew/brew#5420. --- 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 8492b23587..7bb77a3951 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -52,7 +52,7 @@ def curl_download(*args, to: nil, **options) destination.dirname.mkpath continue_at = if destination.exist? && - curl_output("--location", "--head", "--range", "0-1", + curl_output("--location", "--range", "0-1", "--write-out", "%{http_code}", "--output", "/dev/null", *args, **options).stdout.to_i == 206 # Partial Content "-"