aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/dev-cmd
diff options
context:
space:
mode:
authorMike McQuaid2017-01-07 19:28:53 +0000
committerGitHub2017-01-07 19:28:53 +0000
commit871213932763eac4f62ec3a9d2dcbaffdc2042fa (patch)
treefb9c481a6389d6e3117c678b8e92d78acfd0f019 /Library/Homebrew/dev-cmd
parent67d0af9674b749d5bd6abf5b9a7ce1f111c171a4 (diff)
parente7a81caaf4bc0468fdc302656efebd584e10a3f6 (diff)
downloadbrew-871213932763eac4f62ec3a9d2dcbaffdc2042fa.tar.bz2
Merge pull request #1798 from MikeMcQuaid/audit-fake-safari-user-agent
Allow `brew audit` to fake a Safari user-agent.
Diffstat (limited to 'Library/Homebrew/dev-cmd')
-rw-r--r--Library/Homebrew/dev-cmd/audit.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb
index 601031d6e..6d43c51bf 100644
--- a/Library/Homebrew/dev-cmd/audit.rb
+++ b/Library/Homebrew/dev-cmd/audit.rb
@@ -169,7 +169,7 @@ class FormulaAuditor
@specs = %w[stable devel head].map { |s| formula.send(s) }.compact
end
- def url_status_code(url, range: false)
+ def url_status_code(url, range: false, user_agent: :default)
# The system Curl is too old and unreliable with HTTPS homepages on
# Yosemite and below.
return "200" unless DevelopmentTools.curl_handles_most_https_homepages?
@@ -185,7 +185,7 @@ class FormulaAuditor
args = curl_args(
extra_args: extra_args,
show_output: true,
- default_user_agent: true
+ user_agent: user_agent
)
retries = 3
status_code = nil
@@ -597,7 +597,7 @@ class FormulaAuditor
return unless @online
- status_code = url_status_code(homepage)
+ status_code = url_status_code(homepage, user_agent: :browser)
return if status_code.start_with? "20"
problem "The homepage #{homepage} is not reachable (HTTP status code #{status_code})"
end