Merge pull request #5 from github/user-agent

Identify as "GitHub CLI" to API requests
This commit is contained in:
Corey Johnson 2019-10-09 13:13:26 -07:00 committed by GitHub
commit 9856f07dd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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 {