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.
This commit is contained in:
parent
1a78cc77d4
commit
6e603c2859
@ -52,7 +52,7 @@ def curl_download(*args, to: nil, **options)
|
|||||||
destination.dirname.mkpath
|
destination.dirname.mkpath
|
||||||
|
|
||||||
continue_at = if destination.exist? &&
|
continue_at = if destination.exist? &&
|
||||||
curl_output("--location", "--head", "--range", "0-1",
|
curl_output("--location", "--range", "0-1",
|
||||||
"--write-out", "%{http_code}",
|
"--write-out", "%{http_code}",
|
||||||
"--output", "/dev/null", *args, **options).stdout.to_i == 206 # Partial Content
|
"--output", "/dev/null", *args, **options).stdout.to_i == 206 # Partial Content
|
||||||
"-"
|
"-"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user