HTTP DNS请求时增加Content-Type

This commit is contained in:
GoEdgeLab
2022-03-10 19:13:53 +08:00
parent 4084c649a6
commit c5d552833b

View File

@@ -164,10 +164,11 @@ func (this *CustomHTTPProvider) post(params maps.Map) (respData []byte, err erro
if err != nil {
return nil, err
}
timestamp := strconv.FormatInt(time.Now().Unix(), 10)
var 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", teaconst.ProductName+"/"+teaconst.Version)
req.Header.Set("Content-Type", "application/json")
resp, err := customHTTPClient.Do(req)
if err != nil {