Pin GitHub module to v3 API

This commit is contained in:
Jack Nagel 2014-02-08 20:41:11 -05:00
parent e57894e0d8
commit 3b818a19f9

View File

@ -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)