From 202168ee8dbbba01b0a904de3cf58fb64e282a72 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Wed, 30 Jun 2021 17:22:07 -0500 Subject: [PATCH] add nebula preview --- pkg/cmd/factory/http.go | 1 + pkg/cmd/factory/http_test.go | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/factory/http.go b/pkg/cmd/factory/http.go index 0c0abd7b2..28dac1ed6 100644 --- a/pkg/cmd/factory/http.go +++ b/pkg/cmd/factory/http.go @@ -113,6 +113,7 @@ func NewHTTPClient(io *iostreams.IOStreams, cfg configGetter, appVersion string, opts = append(opts, api.AddHeaderFunc("Accept", func(req *http.Request) (string, error) { accept := "application/vnd.github.merge-info-preview+json" // PullRequest.mergeStateStatus + accept += ", application/vnd.github.nebula-preview" // visibility when RESTing repos into an org if ghinstance.IsEnterprise(getHost(req)) { accept += ", application/vnd.github.antiope-preview" // Commit.statusCheckRollup accept += ", application/vnd.github.shadow-cat-preview" // PullRequest.isDraft diff --git a/pkg/cmd/factory/http_test.go b/pkg/cmd/factory/http_test.go index ae4096594..b02a914f8 100644 --- a/pkg/cmd/factory/http_test.go +++ b/pkg/cmd/factory/http_test.go @@ -39,7 +39,7 @@ func TestNewHTTPClient(t *testing.T) { wantHeader: map[string]string{ "authorization": "token MYTOKEN", "user-agent": "GitHub CLI v1.2.3", - "accept": "application/vnd.github.merge-info-preview+json", + "accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview", }, wantStderr: "", }, @@ -69,7 +69,7 @@ func TestNewHTTPClient(t *testing.T) { wantHeader: map[string]string{ "authorization": "", "user-agent": "GitHub CLI v1.2.3", - "accept": "application/vnd.github.merge-info-preview+json", + "accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview", }, wantStderr: "", }, @@ -85,14 +85,14 @@ func TestNewHTTPClient(t *testing.T) { wantHeader: map[string]string{ "authorization": "token MYTOKEN", "user-agent": "GitHub CLI v1.2.3", - "accept": "application/vnd.github.merge-info-preview+json", + "accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview", }, wantStderr: heredoc.Doc(` * Request at