Visit the Qiniu download link to download apk and {"error": "download token auth failed"} appears.

  1. the same resource can sometimes be downloaded and sometimes cannot be downloaded. (currently, it is found that the current), key is uploaded and stored in our mysql table. When I download it, I take the key, from the table and splice the download link.

func (mac * Mac) Sign (data [] byte) (token string) {

h := hmac.New(sha1.New, mac.SecretKey)
h.Write(data)

sign := base64.URLEncoding.EncodeToString(h.Sum(nil))
return fmt.Sprintf("%s:%s", mac.AccessKey, sign)

}
code is encoded using secure urlbase64.

I copy the link to the browser and I can see

in Chinese.
Mar.31,2021

this is because some nodes of the test domain will report a 401 error, so the same link can sometimes be downloaded and sometimes cannot be downloaded.

Menu