Merge pull request #306 from fudiwei/bugfix/dogecloud-api-error

bugfix #303
This commit is contained in:
usual2970 2024-11-06 07:08:12 +08:00 committed by GitHub
commit 741f3ec212
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,7 +153,8 @@ func (c *Client) sendReq(method string, path string, data map[string]interface{}
mime = "application/x-www-form-urlencoded"
}
signStr := path + "\n" + body
path = strings.TrimPrefix(path, "/")
signStr := "/" + path + "\n" + body
hmacObj := hmac.New(sha1.New, []byte(c.secretKey))
hmacObj.Write([]byte(signStr))
sign := hex.EncodeToString(hmacObj.Sum(nil))