Identify as "GitHub CLI" to API requests
This commit is contained in:
parent
e867322ec4
commit
e05889d9f1
2 changed files with 3 additions and 3 deletions
|
|
@ -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})
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue