From 3b818a19f9f3f94ae24b1907b49356155dbe7e96 Mon Sep 17 00:00:00 2001 From: Jack Nagel Date: Sat, 8 Feb 2014 20:41:11 -0500 Subject: [PATCH] Pin GitHub module to v3 API --- Library/Homebrew/utils.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index fbeaf8ec04..6ec85a7144 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)