Skip to content

Commit 202168e

Browse files
author
vilmibm
committed
add nebula preview
1 parent 2723a01 commit 202168e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

pkg/cmd/factory/http.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ func NewHTTPClient(io *iostreams.IOStreams, cfg configGetter, appVersion string,
113113
opts = append(opts,
114114
api.AddHeaderFunc("Accept", func(req *http.Request) (string, error) {
115115
accept := "application/vnd.github.merge-info-preview+json" // PullRequest.mergeStateStatus
116+
accept += ", application/vnd.github.nebula-preview" // visibility when RESTing repos into an org
116117
if ghinstance.IsEnterprise(getHost(req)) {
117118
accept += ", application/vnd.github.antiope-preview" // Commit.statusCheckRollup
118119
accept += ", application/vnd.github.shadow-cat-preview" // PullRequest.isDraft

pkg/cmd/factory/http_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestNewHTTPClient(t *testing.T) {
3939
wantHeader: map[string]string{
4040
"authorization": "token MYTOKEN",
4141
"user-agent": "GitHub CLI v1.2.3",
42-
"accept": "application/vnd.github.merge-info-preview+json",
42+
"accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview",
4343
},
4444
wantStderr: "",
4545
},
@@ -69,7 +69,7 @@ func TestNewHTTPClient(t *testing.T) {
6969
wantHeader: map[string]string{
7070
"authorization": "",
7171
"user-agent": "GitHub CLI v1.2.3",
72-
"accept": "application/vnd.github.merge-info-preview+json",
72+
"accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview",
7373
},
7474
wantStderr: "",
7575
},
@@ -85,14 +85,14 @@ func TestNewHTTPClient(t *testing.T) {
8585
wantHeader: map[string]string{
8686
"authorization": "token MYTOKEN",
8787
"user-agent": "GitHub CLI v1.2.3",
88-
"accept": "application/vnd.github.merge-info-preview+json",
88+
"accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview",
8989
},
9090
wantStderr: heredoc.Doc(`
9191
* Request at <time>
9292
* Request to http://<host>:<port>
9393
> GET / HTTP/1.1
9494
> Host: github.com
95-
> Accept: application/vnd.github.merge-info-preview+json
95+
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
9696
> Authorization: token ████████████████████
9797
> User-Agent: GitHub CLI v1.2.3
9898
@@ -113,7 +113,7 @@ func TestNewHTTPClient(t *testing.T) {
113113
wantHeader: map[string]string{
114114
"authorization": "token GHETOKEN",
115115
"user-agent": "GitHub CLI v1.2.3",
116-
"accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.antiope-preview, application/vnd.github.shadow-cat-preview",
116+
"accept": "application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview, application/vnd.github.antiope-preview, application/vnd.github.shadow-cat-preview",
117117
},
118118
wantStderr: "",
119119
},

0 commit comments

Comments
 (0)