fix URL expired issue #208

This commit is contained in:
tickstep
2022-12-26 21:24:07 +08:00
parent 97a22812a2
commit 0acd6a43d6
5 changed files with 14 additions and 16 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ func IsUrlExpired(urlStr string) bool {
}
expiredTimeSecStr := u.Query().Get("x-oss-expires")
expiredTimeSec, _ := strconv.ParseInt(expiredTimeSecStr, 10, 64)
if (time.Now().Unix() - 10) >= expiredTimeSec {
if (expiredTimeSec - time.Now().Unix()) <= 10 { // 小于10秒
// expired
return true
}