Presign-v4: Allow requests that were signed slightly ahead of the current time. (#3435)

This commit is contained in:
Krishna Srinivas 2016-12-12 16:32:00 -08:00 committed by Harshavardhana
parent 2062add05f
commit 8e665105b1
1 changed files with 3 additions and 1 deletions

View File

@ -250,7 +250,9 @@ func doesPresignedSignatureMatch(hashedPayload string, r *http.Request, region s
query.Set("X-Amz-Algorithm", signV4Algorithm) query.Set("X-Amz-Algorithm", signV4Algorithm)
if pSignValues.Date.After(time.Now().UTC()) { // If the host which signed the request is slightly ahead in time (by less than globalMaxSkewTime) the
// request should still be allowed.
if pSignValues.Date.After(time.Now().UTC().Add(globalMaxSkewTime)) {
return ErrRequestNotReadyYet return ErrRequestNotReadyYet
} }