From d82b3a8d6a3a1229bfd09f1bd012d798c9c8143b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 21 May 2026 09:51:10 -0700 Subject: [PATCH] refactor(s3): drop unused source path in copy ETag check ETagEntry derives the tag from chunks/Md5/remote-etag, never the entry path, so the conditional-copy check no longer builds a bogus FullPath. --- weed/s3api/s3api_object_handlers_copy.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/weed/s3api/s3api_object_handlers_copy.go b/weed/s3api/s3api_object_handlers_copy.go index 59338ac15..59534fb6d 100644 --- a/weed/s3api/s3api_object_handlers_copy.go +++ b/weed/s3api/s3api_object_handlers_copy.go @@ -1296,10 +1296,9 @@ func (s3a *S3ApiServer) copyChunksForRange(entry *filer_pb.Entry, startOffset, e // validateConditionalCopyHeaders validates the conditional copy headers against the source entry func (s3a *S3ApiServer) validateConditionalCopyHeaders(r *http.Request, entry *filer_pb.Entry) s3err.ErrorCode { - // Calculate ETag for the source entry - srcPath := util.FullPath(fmt.Sprintf("%s/%s", r.URL.Path, entry.Name)) + // Calculate ETag for the source entry. ETagEntry derives the tag from the + // chunks/Md5/remote-etag only, so no path is needed here. filerEntry := &filer.Entry{ - FullPath: srcPath, Attr: filer.Attr{ FileSize: entry.Attributes.FileSize, Mtime: time.Unix(entry.Attributes.Mtime, 0),