From dc287189c098690cab775b75e22cf0482d47f9ac Mon Sep 17 00:00:00 2001 From: Glenn Lewis Date: Wed, 13 Jul 2016 10:52:18 -0700 Subject: [PATCH] Stop using custom media type for Multiple Assignees. Fixes #399. Fixes #401. Change-Id: I97be757ad8672c649076ecbb0a51d60576d29164 --- github/github.go | 3 --- github/issues.go | 6 ------ github/issues_assignees.go | 6 ------ github/issues_assignees_test.go | 2 -- github/issues_test.go | 2 -- 5 files changed, 19 deletions(-) diff --git a/github/github.go b/github/github.go index deb3c16..4faf09c 100644 --- a/github/github.go +++ b/github/github.go @@ -73,9 +73,6 @@ const ( // https://developer.github.com/changes/2016-04-04-git-signing-api-preview/ mediaTypeGitSigningPreview = "application/vnd.github.cryptographer-preview+json" - // https://developer.github.com/changes/2016-5-27-multiple-assignees/ - mediaTypeMultipleAssigneesPreview = "application/vnd.github.cerberus-preview+json" - // https://developer.github.com/changes/2016-05-23-timeline-preview-api/ mediaTypeTimelinePreview = "application/vnd.github.mockingbird-preview+json" diff --git a/github/issues.go b/github/issues.go index 58a85ec..02c82cd 100644 --- a/github/issues.go +++ b/github/issues.go @@ -244,9 +244,6 @@ func (s *IssuesService) Create(owner string, repo string, issue *IssueRequest) ( return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview) - i := new(Issue) resp, err := s.client.Do(req, i) if err != nil { @@ -266,9 +263,6 @@ func (s *IssuesService) Edit(owner string, repo string, number int, issue *Issue return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview) - i := new(Issue) resp, err := s.client.Do(req, i) if err != nil { diff --git a/github/issues_assignees.go b/github/issues_assignees.go index 4b7bba2..2503be1 100644 --- a/github/issues_assignees.go +++ b/github/issues_assignees.go @@ -58,9 +58,6 @@ func (s *IssuesService) AddAssignees(owner, repo string, number int, assignees [ return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview) - issue := &Issue{} resp, err := s.client.Do(req, issue) return issue, resp, err @@ -79,9 +76,6 @@ func (s *IssuesService) RemoveAssignees(owner, repo string, number int, assignee return nil, nil, err } - // TODO: remove custom Accept header when this API fully launches. - req.Header.Set("Accept", mediaTypeMultipleAssigneesPreview) - issue := &Issue{} resp, err := s.client.Do(req, issue) return issue, resp, err diff --git a/github/issues_assignees_test.go b/github/issues_assignees_test.go index 2c42d8d..73d521e 100644 --- a/github/issues_assignees_test.go +++ b/github/issues_assignees_test.go @@ -109,7 +109,6 @@ func TestIssuesService_AddAssignees(t *testing.T) { json.NewDecoder(r.Body).Decode(&assignees) testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeMultipleAssigneesPreview) want := []string{"user1", "user2"} if !reflect.DeepEqual(assignees.Assignees, want) { t.Errorf("assignees = %+v, want %+v", assignees, want) @@ -139,7 +138,6 @@ func TestIssuesService_RemoveAssignees(t *testing.T) { json.NewDecoder(r.Body).Decode(&assignees) testMethod(t, r, "DELETE") - testHeader(t, r, "Accept", mediaTypeMultipleAssigneesPreview) want := []string{"user1", "user2"} if !reflect.DeepEqual(assignees.Assignees, want) { t.Errorf("assignees = %+v, want %+v", assignees, want) diff --git a/github/issues_test.go b/github/issues_test.go index 3b436de..5e6369e 100644 --- a/github/issues_test.go +++ b/github/issues_test.go @@ -188,7 +188,6 @@ func TestIssuesService_Create(t *testing.T) { json.NewDecoder(r.Body).Decode(v) testMethod(t, r, "POST") - testHeader(t, r, "Accept", mediaTypeMultipleAssigneesPreview) if !reflect.DeepEqual(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) } @@ -223,7 +222,6 @@ func TestIssuesService_Edit(t *testing.T) { json.NewDecoder(r.Body).Decode(v) testMethod(t, r, "PATCH") - testHeader(t, r, "Accept", mediaTypeMultipleAssigneesPreview) if !reflect.DeepEqual(v, input) { t.Errorf("Request body = %+v, want %+v", v, input) }