API相关HTTP请求增加User-Agent

This commit is contained in:
GoEdgeLab
2022-01-10 09:58:34 +08:00
parent d1867b8bbf
commit 00cba6a380
3 changed files with 5 additions and 1 deletions

View File

@@ -165,7 +165,7 @@ func (this *CustomHTTPProvider) post(params maps.Map) (respData []byte, err erro
timestamp := strconv.FormatInt(time.Now().Unix(), 10)
req.Header.Set("Timestamp", timestamp)
req.Header.Set("Token", fmt.Sprintf("%x", sha1.Sum([]byte(this.secret+"@"+timestamp))))
req.Header.Set("User-Agent", "GoEdge/"+teaconst.Version)
req.Header.Set("User-Agent", teaconst.ProductName+"/"+teaconst.Version)
resp, err := customHTTPClient.Do(req)
if err != nil {