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
2 changes: 1 addition & 1 deletion github/repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func (s *RepositoriesService) List(ctx context.Context, user string, opts *Repos
}

// TODO: remove custom Accept headers when APIs fully launch.
acceptHeaders := []string{mediaTypeTopicsPreview}
acceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))

var repos []*Repository
Expand Down
6 changes: 3 additions & 3 deletions github/repos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestRepositoriesService_List_authenticatedUser(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

wantAcceptHeaders := []string{mediaTypeTopicsPreview}
wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}
mux.HandleFunc("/user/repos", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))
Expand Down Expand Up @@ -56,7 +56,7 @@ func TestRepositoriesService_List_specifiedUser(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

wantAcceptHeaders := []string{mediaTypeTopicsPreview}
wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}
mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))
Expand Down Expand Up @@ -93,7 +93,7 @@ func TestRepositoriesService_List_specifiedUser_type(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

wantAcceptHeaders := []string{mediaTypeTopicsPreview}
wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview}
mux.HandleFunc("/users/u/repos", func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))
Expand Down