From bd9bf3693f7fdf4d0bef73a4770a947822bfc73e Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Fri, 23 Jun 2023 00:17:24 -0700 Subject: [PATCH] lambda: negative duration for presigned URL default to 1H (#17489) fixes a bug where users created with Expiration as timeSentinel is not rejected while generating the presigned URL for lambda processing. --- cmd/object-lambda-handlers.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/object-lambda-handlers.go b/cmd/object-lambda-handlers.go index fe97cc6ed..7270c4bd6 100644 --- a/cmd/object-lambda-handlers.go +++ b/cmd/object-lambda-handlers.go @@ -47,7 +47,7 @@ func getLambdaEventData(bucket, object string, cred auth.Credentials, r *http.Re } duration := time.Until(cred.Expiration) - if cred.Expiration.IsZero() || duration > time.Hour { + if duration > time.Hour || duration < time.Hour { // Always limit to 1 hour. duration = time.Hour }