From ec15acf7dc15bfb28ae00f78e77abd117361601a Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 31 Mar 2023 09:07:02 +0100 Subject: [PATCH] Revert "Remove `--request GET` workaround for HEAD requests." --- Library/Homebrew/download_strategy.rb | 2 +- Library/Homebrew/livecheck/strategy.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 709e048d9b..0074b62ec7 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -464,7 +464,7 @@ class CurlDownloadStrategy < AbstractFileDownloadStrategy end output, _, _status = curl_output( - "--location", "--silent", "--head", url.to_s, + "--location", "--silent", "--head", "--request", "GET", url.to_s, timeout: timeout ) parsed_output = parse_curl_output(output) diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index cac1627b5a..45b671defd 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -59,6 +59,8 @@ module Homebrew PAGE_HEADERS_CURL_ARGS = ([ # We only need the response head (not the body) "--head", + # Some servers may not allow a HEAD request, so we use GET + "--request", "GET" ] + DEFAULT_CURL_ARGS).freeze # `curl` arguments used in `Strategy#page_content` method.