From 86bce7bf1de0e7ef6793493d0a0c674432ea8b6c Mon Sep 17 00:00:00 2001 From: cnnrmnn Date: Fri, 14 May 2021 09:50:57 -0400 Subject: [PATCH] Stop unnecessarily dumping headers --- Library/Homebrew/utils/curl.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index a2566cf521..ae181c6e27 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -122,7 +122,7 @@ module Utils return {} unless headers # Skip status code - headers.split("\r\n")[2..].to_h { |h| h.split(": ") } + headers.split("\r\n")[1..].to_h { |h| h.split(": ") } end def curl_download(*args, to: nil, try_partial: true, **options) @@ -130,8 +130,7 @@ module Utils destination.dirname.mkpath if try_partial - range_stdout = curl_output("--location", "--dump-header", "-", - "--head", *args, **options).stdout + range_stdout = curl_output("--location", "--head", *args, **options).stdout headers = parse_headers(range_stdout.split("\r\n\r\n").first) # Any value for `accept-ranges` other than none indicates that the server supports partial requests.