diff --git a/pkg/cmd/api/api.go b/pkg/cmd/api/api.go index 6b393cc42..15a2b3be4 100644 --- a/pkg/cmd/api/api.go +++ b/pkg/cmd/api/api.go @@ -218,7 +218,7 @@ func apiRun(opts *ApiOptions) error { } func processResponse(resp *http.Response, opts *ApiOptions) (endCursor string, err error) { - if opts.ShowResponseHeaders { + if opts.ShowResponseHeaders && !opts.Silent { fmt.Fprintln(opts.IO.Out, resp.Proto, resp.Status) printHeaders(opts.IO.Out, resp.Header, opts.IO.ColorEnabled()) fmt.Fprint(opts.IO.Out, "\r\n") diff --git a/pkg/cmd/api/api_test.go b/pkg/cmd/api/api_test.go index a41f82c54..75c8eaa4a 100644 --- a/pkg/cmd/api/api_test.go +++ b/pkg/cmd/api/api_test.go @@ -467,8 +467,9 @@ func Test_apiRun_silent(t *testing.T) { } return &http.Client{Transport: tr}, nil }, - RequestPath: "issues", - Silent: true, + RequestPath: "issues", + ShowResponseHeaders: true, + Silent: true, } err := apiRun(&options)