From a5dbba5b972f4d8a4a4aa0e7944238d084c6d0ad Mon Sep 17 00:00:00 2001 From: Markus Reiter <me@reitermark.us> Date: Thu, 10 Dec 2020 07:35:43 +0100 Subject: [PATCH] Fix `curl_http_content_headers_and_checksum`. --- 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 afcc85712c..d7a4746290 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -249,7 +249,7 @@ module Utils final_url = location.chomp if location end - output_hash = Digest::SHA256.file(file.path) if hash_needed + file_hash = Digest::SHA256.file(file.path) if hash_needed final_url ||= url @@ -260,8 +260,8 @@ module Utils etag: headers[%r{ETag: ([wW]/)?"(([^"]|\\")*)"}, 2], content_length: headers[/Content-Length: (\d+)/, 1], headers: headers, - file_hash: output_hash, - file: output, + file_hash: file_hash, + file: File.read(file.path), } ensure file.unlink -- GitLab