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()