Browse Source

removed authorization preview header

Fixes #464.
Closes #465.

Change-Id: I9bde509ef6bf9382c48344e58d4a77da4b33e4a3
Ronak Jain 9 years ago
committed by Glenn Lewis
parent
commit
5494398587
3 changed files with 0 additions and 15 deletions
  1. +0
    -9
      github/authorizations.go
  2. +0
    -3
      github/authorizations_test.go
  3. +0
    -3
      github/github.go

+ 0
- 9
github/authorizations.go View File

@ -346,9 +346,6 @@ func (s *AuthorizationsService) ListGrants() ([]*Grant, *Response, error) {
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeOAuthGrantAuthorizationsPreview)
grants := []*Grant{}
resp, err := s.client.Do(req, &grants)
if err != nil {
@ -368,9 +365,6 @@ func (s *AuthorizationsService) GetGrant(id int) (*Grant, *Response, error) {
return nil, nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeOAuthGrantAuthorizationsPreview)
grant := new(Grant)
resp, err := s.client.Do(req, grant)
if err != nil {
@ -392,9 +386,6 @@ func (s *AuthorizationsService) DeleteGrant(id int) (*Response, error) {
return nil, err
}
// TODO: remove custom Accept header when this API fully launches.
req.Header.Set("Accept", mediaTypeOAuthGrantAuthorizationsPreview)
return s.client.Do(req, nil)
}


+ 0
- 3
github/authorizations_test.go View File

@ -256,7 +256,6 @@ func TestListGrants(t *testing.T) {
mux.HandleFunc("/applications/grants", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeOAuthGrantAuthorizationsPreview)
fmt.Fprint(w, `[{"id": 1}]`)
})
@ -277,7 +276,6 @@ func TestGetGrant(t *testing.T) {
mux.HandleFunc("/applications/grants/1", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", mediaTypeOAuthGrantAuthorizationsPreview)
fmt.Fprint(w, `{"id": 1}`)
})
@ -298,7 +296,6 @@ func TestDeleteGrant(t *testing.T) {
mux.HandleFunc("/applications/grants/1", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "DELETE")
testHeader(t, r, "Accept", mediaTypeOAuthGrantAuthorizationsPreview)
})
_, err := client.Authorizations.DeleteGrant(1)


+ 0
- 3
github/github.go View File

@ -79,9 +79,6 @@ const (
// https://developer.github.com/changes/2016-06-14-repository-invitations/
mediaTypeRepositoryInvitationsPreview = "application/vnd.github.swamp-thing-preview+json"
// https://developer.github.com/changes/2016-04-21-oauth-authorizations-grants-api-preview/
mediaTypeOAuthGrantAuthorizationsPreview = "application/vnd.github.damage-preview+json"
// https://developer.github.com/changes/2016-07-06-github-pages-preiew-api/
mediaTypePagesPreview = "application/vnd.github.mister-fantastic-preview+json"


Loading…
Cancel
Save