From 9f2b695238d5181e35dc26b0f5cb4a2a3065d276 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 25 Nov 2025 12:14:02 -0800 Subject: [PATCH] copy for non versioned files --- weed/s3api/s3api_object_handlers_copy.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/weed/s3api/s3api_object_handlers_copy.go b/weed/s3api/s3api_object_handlers_copy.go index 4852205cc..9763f7a6f 100644 --- a/weed/s3api/s3api_object_handlers_copy.go +++ b/weed/s3api/s3api_object_handlers_copy.go @@ -295,6 +295,11 @@ func (s3a *S3ApiServer) CopyObjectHandler(w http.ResponseWriter, r *http.Request w.Header().Set("x-amz-version-id", dstVersionId) } else { // For non-versioned destination, use regular copy + // Remove any versioning-related metadata from source that shouldn't carry over + delete(dstEntry.Extended, s3_constants.ExtVersionIdKey) + delete(dstEntry.Extended, s3_constants.ExtDeleteMarkerKey) + delete(dstEntry.Extended, s3_constants.ExtIsLatestKey) + dstPath := util.FullPath(fmt.Sprintf("%s/%s%s", s3a.option.BucketsPath, dstBucket, dstObject)) dstDir, dstName := dstPath.DirAndName()