diff --git a/github/repos.go b/github/repos.go index 22c0f8faeeb..989f2756adf 100644 --- a/github/repos.go +++ b/github/repos.go @@ -248,7 +248,7 @@ func (s *RepositoriesService) ListByOrg(ctx context.Context, org string, opts *R } // 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 diff --git a/github/repos_test.go b/github/repos_test.go index bbe82ea6a75..192378eab7d 100644 --- a/github/repos_test.go +++ b/github/repos_test.go @@ -131,7 +131,7 @@ func TestRepositoriesService_ListByOrg(t *testing.T) { client, mux, _, teardown := setup() defer teardown() - wantAcceptHeaders := []string{mediaTypeTopicsPreview} + wantAcceptHeaders := []string{mediaTypeTopicsPreview, mediaTypeRepositoryVisibilityPreview} mux.HandleFunc("/orgs/o/repos", func(w http.ResponseWriter, r *http.Request) { testMethod(t, r, "GET") testHeader(t, r, "Accept", strings.Join(wantAcceptHeaders, ", "))