aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
authorMike McQuaid2016-03-10 13:41:02 +0000
committerXu Cheng2016-03-11 13:32:54 +0800
commit2c3a7e8c75d90091c06a82e315ca22dbd918c5be (patch)
treefb0dc550f3c0c5d1e16e68fe234e48dcec4059bc /Library/Homebrew/cmd
parentc8debd8fa46f8d7bf8ac329b4a53301b5271b895 (diff)
downloadbrew-2c3a7e8c75d90091c06a82e315ca22dbd918c5be.tar.bz2
Fix `brew update` user agent.
This needs to be `Homebrew $HOMEBREW_VERSION` so we can be adequately filtered. Closes Homebrew/homebrew#49961. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/update.sh5
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh
index 13bce9909..49df783f2 100644
--- a/Library/Homebrew/cmd/update.sh
+++ b/Library/Homebrew/cmd/update.sh
@@ -342,8 +342,9 @@ EOS
# (so the API does not return 304: unmodified).
UPSTREAM_SHA_HTTP_CODE="$(curl --silent '--max-time' 3 \
--output /dev/null --write-out "%{http_code}" \
- -H "Accept: application/vnd.github.chitauri-preview+sha" \
- -H "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
+ --user-agent "Homebrew $HOMEBREW_VERSION" \
+ --header "Accept: application/vnd.github.chitauri-preview+sha" \
+ --header "If-None-Match: \"$UPSTREAM_BRANCH_LOCAL_SHA\"" \
"https://api.github.com/repos/$UPSTREAM_REPOSITORY/commits/$UPSTREAM_BRANCH")"
[[ "$UPSTREAM_SHA_HTTP_CODE" = "304" ]] && exit
fi