From 803234d381661d99ff50c4802148b128092f4f6c Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 5 Sep 2020 04:10:25 +0200 Subject: [PATCH 1/2] Ignore URLs protected by CloudFlare when auditing. --- Library/Homebrew/utils/curl.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 2318579ee0..b57ff68b63 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -128,6 +128,13 @@ def curl_check_http_content(url, user_agents: [:default], check_content: false, end unless http_status_ok?(details[:status]) + # The URL is protected by CloudFlare. + if details[:status].to_i == 503 && + details[:file].include?("set-cookie: __cfduid=") && + details[:file].include?("server: cloudflare") + return + end + return "The URL #{url} is not reachable (HTTP status code #{details[:status]})" end From b2b37894f7a719b8b97c07498cd30e2c338235f7 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Sat, 5 Sep 2020 20:26:18 +0200 Subject: [PATCH 2/2] Reword comment. Co-authored-by: Seeker --- Library/Homebrew/utils/curl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index b57ff68b63..121e183262 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -128,7 +128,7 @@ def curl_check_http_content(url, user_agents: [:default], check_content: false, end unless http_status_ok?(details[:status]) - # The URL is protected by CloudFlare. + # Check if the URL is protected by CloudFlare. if details[:status].to_i == 503 && details[:file].include?("set-cookie: __cfduid=") && details[:file].include?("server: cloudflare")