aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-02-08 20:41:11 -0500
committerJack Nagel2014-02-08 20:41:11 -0500
commit849d6a0fb5fb21183c4f7fc8389bb1bc2aac06ba (patch)
tree1d1bef71e2163ac67541601be0b81e7c0bcddd68 /Library
parent27402354d1c72c14ac8a6f555dee7793b3b27e40 (diff)
downloadhomebrew-849d6a0fb5fb21183c4f7fc8389bb1bc2aac06ba.tar.bz2
Pin GitHub module to v3 API
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index fbeaf8ec0..6ec85a714 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -260,7 +260,11 @@ module GitHub extend self
require 'net/https' # for exception classes below
- default_headers = {'User-Agent' => HOMEBREW_USER_AGENT}
+ default_headers = {
+ "User-Agent" => HOMEBREW_USER_AGENT,
+ "Accept" => "application/vnd.github.v3+json",
+ }
+
default_headers['Authorization'] = "token #{HOMEBREW_GITHUB_API_TOKEN}" if HOMEBREW_GITHUB_API_TOKEN
Kernel.open(url, default_headers.merge(headers)) do |f|
yield Utils::JSON.load(f.read)