Merge pull request #1 from phillmv/fix-verify-api-requests

Fix: the wrong hostname was being passed in to the API client
This commit is contained in:
Meredith Lancaster 2024-03-25 11:21:45 -06:00 committed by GitHub
commit 64c3fd02aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -7,7 +7,6 @@ import (
"strings"
"github.com/cli/cli/v2/api"
"github.com/cli/cli/v2/internal/ghinstance"
ioconfig "github.com/cli/cli/v2/pkg/cmd/attestation/io"
"github.com/cli/go-gh/v2/pkg/auth"
)
@ -35,11 +34,10 @@ type LiveClient struct {
func NewLiveClient(hc *http.Client, l *ioconfig.Handler) *LiveClient {
host, _ := auth.DefaultHost()
serverURL := ghinstance.HostPrefix(host)
return &LiveClient{
api: api.NewClientFromHTTP(hc),
host: strings.TrimSuffix(serverURL, "/"),
host: strings.TrimSuffix(host, "/"),
logger: l,
}
}