Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@ const (
// https://developer.github.com/changes/2016-05-12-reactions-api-preview/
mediaTypeReactionsPreview = "application/vnd.github.squirrel-girl-preview"

// https://developer.github.com/changes/2016-04-01-squash-api-preview/
// https://developer.github.com/changes/2016-09-26-pull-request-merge-api-update/
mediaTypeSquashPreview = "application/vnd.github.polaris-preview+json"

// https://developer.github.com/changes/2016-04-04-git-signing-api-preview/
mediaTypeGitSigningPreview = "application/vnd.github.cryptographer-preview+json"

Expand Down
3 changes: 0 additions & 3 deletions github/pulls.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,6 @@ func (s *PullRequestsService) Merge(ctx context.Context, owner string, repo stri
return nil, nil, err
}

// TODO: This header will be unnecessary when the API is no longer in preview.
req.Header.Set("Accept", mediaTypeSquashPreview)

mergeResult := new(PullRequestMergeResult)
resp, err := s.client.Do(ctx, req, mergeResult)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions github/pulls_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,6 @@ func TestPullRequestsService_Merge(t *testing.T) {

mux.HandleFunc("/repos/o/r/pulls/1/merge", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
testHeader(t, r, "Accept", mediaTypeSquashPreview)
fmt.Fprint(w, `
{
"sha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
Expand Down Expand Up @@ -500,7 +499,6 @@ func TestPullRequestsService_Merge_options(t *testing.T) {
madeRequest := false
mux.HandleFunc(fmt.Sprintf("/repos/o/r/pulls/%d/merge", i), func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "PUT")
testHeader(t, r, "Accept", mediaTypeSquashPreview)
testBody(t, r, test.wantBody+"\n")
madeRequest = true
})
Expand Down
5 changes: 1 addition & 4 deletions github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (s *RepositoriesService) Get(ctx context.Context, owner, repo string) (*Rep

// TODO: remove custom Accept header when the license support fully launches
// https://developer.github.com/v3/licenses/#get-a-repositorys-license
acceptHeaders := []string{mediaTypeLicensesPreview, mediaTypeSquashPreview, mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview}
acceptHeaders := []string{mediaTypeLicensesPreview, mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview}
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))

repository := new(Repository)
Expand Down Expand Up @@ -365,9 +365,6 @@ func (s *RepositoriesService) Edit(ctx context.Context, owner, repo string, repo
return nil, nil, err
}

// TODO: Remove this preview header after API is fully vetted.
req.Header.Set("Accept", mediaTypeSquashPreview)

r := new(Repository)
resp, err := s.client.Do(ctx, req, r)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion github/repos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func TestRepositoriesService_Get(t *testing.T) {
setup()
defer teardown()

acceptHeaders := []string{mediaTypeLicensesPreview, mediaTypeSquashPreview, mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview}
acceptHeaders := []string{mediaTypeLicensesPreview, mediaTypeCodesOfConductPreview, mediaTypeTopicsPreview}
mux.HandleFunc("/repos/o/r", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
Expand Down