From a1566212976072d8b5b95f5b335a3d98f77c713d Mon Sep 17 00:00:00 2001 From: cnnrmnn Date: Fri, 14 May 2021 09:44:05 -0400 Subject: [PATCH] Simplify header parsing --- Library/Homebrew/utils/curl.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 32161e4286..a2566cf521 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -121,10 +121,8 @@ module Utils def parse_headers(headers) return {} unless headers - headers.split("\n").to_h do |h| - partitioned = h.partition(": ") - [partitioned.first, partitioned.last] - end + # Skip status code + headers.split("\r\n")[2..].to_h { |h| h.split(": ") } end def curl_download(*args, to: nil, try_partial: true, **options)