aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils
diff options
context:
space:
mode:
authorMike McQuaid2017-01-07 14:03:08 +0000
committerMike McQuaid2017-01-07 14:03:08 +0000
commite7a81caaf4bc0468fdc302656efebd584e10a3f6 (patch)
tree43f7af993518340e3e5bf9d95ec1bfc7d76901fd /Library/Homebrew/utils
parent2aac904eac522a4d746a852ecc244509f5cfdafa (diff)
downloadbrew-e7a81caaf4bc0468fdc302656efebd584e10a3f6.tar.bz2
Allow `brew audit` to fake a Safari user-agent.
This allows us to detect if homepages such as e.g. `aiccu` which blocks `curl` are up or not.
Diffstat (limited to 'Library/Homebrew/utils')
-rw-r--r--Library/Homebrew/utils/curl.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb
index eab623c40..5a40ae846 100644
--- a/Library/Homebrew/utils/curl.rb
+++ b/Library/Homebrew/utils/curl.rb
@@ -12,7 +12,10 @@ def curl_args(options = {})
"--location",
]
- unless options[:default_user_agent]
+ case options[:user_agent]
+ when :browser
+ args << "--user-agent" << HOMEBREW_USER_AGENT_FAKE_SAFARI
+ else
args << "--user-agent" << HOMEBREW_USER_AGENT_CURL
end