gist-logs: send an Accept header with the request

This commit is contained in:
Jack Nagel 2014-09-07 17:41:55 -05:00
parent 08c581d5e7
commit 24a133f119

View File

@ -63,12 +63,17 @@ def http
end end
def make_request(path, data) def make_request(path, data)
request = Net::HTTP::Post.new(path) headers = {
request['User-Agent'] = HOMEBREW_USER_AGENT "User-Agent" => HOMEBREW_USER_AGENT,
request['Content-Type'] = 'application/json' "Accept" => "application/vnd.github.v3+json",
"Content-Type" => "application/json",
}
if HOMEBREW_GITHUB_API_TOKEN if HOMEBREW_GITHUB_API_TOKEN
request['Authorization'] = "token #{HOMEBREW_GITHUB_API_TOKEN}" headers["Authorization"] = "token #{HOMEBREW_GITHUB_API_TOKEN}"
end end
request = Net::HTTP::Post.new(path, headers)
request.body = Utils::JSON.dump(data) request.body = Utils::JSON.dump(data)
request request
end end