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.
This commit is contained in:
Harshavardhana 2023-06-23 00:17:24 -07:00 committed by GitHub
parent 15daa2e74a
commit bd9bf3693f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,7 +47,7 @@ func getLambdaEventData(bucket, object string, cred auth.Credentials, r *http.Re
} }
duration := time.Until(cred.Expiration) duration := time.Until(cred.Expiration)
if cred.Expiration.IsZero() || duration > time.Hour { if duration > time.Hour || duration < time.Hour {
// Always limit to 1 hour. // Always limit to 1 hour.
duration = time.Hour duration = time.Hour
} }