Add Request Not Ready error when presigned date request is not valid (#2646)

This commit is contained in:
Anis Elleuch
2016-09-10 08:38:07 +01:00
committed by Harshavardhana
parent 32201a18ab
commit 11785529fc
2 changed files with 10 additions and 0 deletions
+4
View File
@@ -246,6 +246,10 @@ func doesPresignedSignatureMatch(hashedPayload string, r *http.Request, validate
query.Set("X-Amz-Algorithm", signV4Algorithm)
if pSignValues.Date.After(time.Now().UTC()) {
return ErrRequestNotReadyYet
}
if time.Now().UTC().Sub(pSignValues.Date) > time.Duration(pSignValues.Expires) {
return ErrExpiredPresignRequest
}