From 8e665105b1c104c2aa0d129b9d876dd881e1b57a Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Mon, 12 Dec 2016 16:32:00 -0800 Subject: [PATCH] Presign-v4: Allow requests that were signed slightly ahead of the current time. (#3435) --- cmd/signature-v4.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/signature-v4.go b/cmd/signature-v4.go index 333d4ecf3..2e6a0dda4 100644 --- a/cmd/signature-v4.go +++ b/cmd/signature-v4.go @@ -250,7 +250,9 @@ func doesPresignedSignatureMatch(hashedPayload string, r *http.Request, region s 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 }