Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use v3 media type by default, fixes #21
  • Loading branch information
iangreenleaf committed Apr 13, 2014
1 parent ff9e5fb commit d5e4b30
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Expand Up @@ -116,7 +116,7 @@ in increasing order of precedence:

* `apiVersion`/`process.env.HUBOT_GITHUB_API_VERSION`:
[Version of the API](http://developer.github.com/v3/versions/)
to access. Defaults to 'beta'.
to access. Defaults to 'v3'.

* `defaultUser`/`process.env.HUBOT_GITHUB_USER`:
Default GitHub username to use if one is not given.
Expand Down
2 changes: 1 addition & 1 deletion githubot.coffee
Expand Up @@ -170,7 +170,7 @@ class Github
when "apiRoot"
process.env.HUBOT_GITHUB_API ? "https://api.github.com"
when "apiVersion"
process.env.HUBOT_GITHUB_API_VERSION ? "beta"
process.env.HUBOT_GITHUB_API_VERSION ? "v3"
else null

module.exports = github = (robot, options = {}) ->
Expand Down
4 changes: 2 additions & 2 deletions test/request.coffee
Expand Up @@ -25,7 +25,7 @@ describe "github api", ->
gh.request "GET", "repos/foo/bar/branches", success done
delete process.env.HUBOT_GITHUB_TOKEN
it "includes accept header", (done) ->
network.matchHeader('Accept', 'application/vnd.github.beta+json')
network.matchHeader('Accept', 'application/vnd.github.v3+json')
gh.request "GET", "repos/foo/bar/branches", success done
it "allows setting API version", (done) ->
ghPreview = require("..") mock_robot, apiVersion: 'preview'
Expand All @@ -45,7 +45,7 @@ describe "github api", ->
network.done()
network2 = nock("https://api.github.com")
.get("/repos/baz/bar/branches")
.matchHeader('Accept', 'application/vnd.github.beta+json')
.matchHeader('Accept', 'application/vnd.github.v3+json')
.reply(200, response)
# Should revert to the defaults on this request
gh.request "GET", "repos/baz/bar/branches", ->
Expand Down

0 comments on commit d5e4b30

Please sign in to comment.