Identify as "GitHub CLI" to API requests

This commit is contained in:
Mislav Marohnić 2019-10-08 13:25:49 +02:00
parent e867322ec4
commit e05889d9f1
2 changed files with 3 additions and 3 deletions

View file

@ -17,10 +17,10 @@ import (
const (
GitHubHost string = "github.com"
OAuthAppURL string = "https://hub.github.com/"
OAuthAppURL string = "https://github.com/github/gh-cli"
)
var UserAgent = "Hub " + version.Version
var userAgent = "GitHub CLI " + version.Version
func NewClient(h string) *Client {
return NewClientWithHost(&Host{Host: h})

View file

@ -221,7 +221,7 @@ func (c *simpleClient) performRequestUrl(method string, url *url.URL, body io.Re
if c.PrepareRequest != nil {
c.PrepareRequest(req)
}
req.Header.Set("User-Agent", UserAgent)
req.Header.Set("User-Agent", userAgent)
req.Header.Set("Accept", apiPayloadVersion)
if configure != nil {