From bcddf998384753bbcf78b4cf825fc4d42bd4a384 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Mon, 15 May 2023 13:14:13 -0400 Subject: [PATCH] Strategy: Pass --max-redirs to #curl_headers The default curl args in `#curl_headers` cover most of `Livecheck::Strategy::DEFAULT_CURL_ARGS` but `--max-redirs` was overlooked. This adds an explicit `--max-redirs` argument in the `#page_headers` `#curl_headers` call but it's worth mentioning that this approach wouldn't benefit from any changes in `DEFAULT_CURL_ARGS` and would need to be manually kept in parity. --- Library/Homebrew/livecheck/strategy.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index abe14e200f..6cee9ded13 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -184,6 +184,8 @@ module Homebrew [:default, :browser].each do |user_agent| begin parsed_output = curl_headers( + "--max-redirs", + MAX_REDIRECTIONS.to_s, url, wanted_headers: ["location", "content-disposition"], use_homebrew_curl: homebrew_curl,