From 50fcf9b670e22d8a402e23450910725835b83458 Mon Sep 17 00:00:00 2001 From: MagicPig Date: Wed, 23 Jul 2025 20:36:06 +0800 Subject: [PATCH] fix boundary value bug when objTime ends in whole seconds (without sub-second) (#21419) --- cmd/object-handlers-common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/object-handlers-common.go b/cmd/object-handlers-common.go index b530441ac..a6febc122 100644 --- a/cmd/object-handlers-common.go +++ b/cmd/object-handlers-common.go @@ -331,7 +331,7 @@ func checkPreconditions(ctx context.Context, w http.ResponseWriter, r *http.Requ func ifModifiedSince(objTime time.Time, givenTime time.Time) bool { // The Date-Modified header truncates sub-second precision, so // use mtime < t+1s instead of mtime <= t to check for unmodified. - return objTime.After(givenTime.Add(1 * time.Second)) + return !objTime.Before(givenTime.Add(1 * time.Second)) } // canonicalizeETag returns ETag with leading and trailing double-quotes removed,