diff options
| author | Mike McQuaid | 2017-01-07 14:03:08 +0000 |
|---|---|---|
| committer | Mike McQuaid | 2017-01-07 14:03:08 +0000 |
| commit | e7a81caaf4bc0468fdc302656efebd584e10a3f6 (patch) | |
| tree | 43f7af993518340e3e5bf9d95ec1bfc7d76901fd /Library/Homebrew/utils | |
| parent | 2aac904eac522a4d746a852ecc244509f5cfdafa (diff) | |
| download | brew-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.rb | 5 |
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 |
