mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-20 18:07:59 +00:00
feat: add user-agent http header for thirdparty sdks
This commit is contained in:
@@ -32,6 +32,7 @@ func NewClient(serverUrl, apiRole, accessKeyId, accessKey string) *Client {
|
||||
}
|
||||
client.client = resty.New().
|
||||
SetBaseURL(strings.TrimRight(serverUrl, "/")).
|
||||
SetHeader("User-Agent", "certimate").
|
||||
SetPreRequestHook(func(c *resty.Client, req *http.Request) error {
|
||||
if client.accessToken != "" {
|
||||
req.Header.Set("X-Cloud-Access-Token", client.accessToken)
|
||||
|
Reference in New Issue
Block a user