aboutsummaryrefslogtreecommitdiff
path: root/weed/s3api/s3api_object_handlers_put.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/s3api/s3api_object_handlers_put.go')
-rw-r--r--weed/s3api/s3api_object_handlers_put.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/weed/s3api/s3api_object_handlers_put.go b/weed/s3api/s3api_object_handlers_put.go
index fb7d6c3a6..1fff23545 100644
--- a/weed/s3api/s3api_object_handlers_put.go
+++ b/weed/s3api/s3api_object_handlers_put.go
@@ -1257,6 +1257,11 @@ func (s3a *S3ApiServer) getObjectETag(entry *filer_pb.Entry) string {
if etagBytes, hasETag := entry.Extended[s3_constants.ExtETagKey]; hasETag {
return string(etagBytes)
}
+ // Check for Md5 in Attributes (matches filer.ETag behavior)
+ // Note: len(nil slice) == 0 in Go, so no need for explicit nil check
+ if entry.Attributes != nil && len(entry.Attributes.Md5) > 0 {
+ return fmt.Sprintf("\"%x\"", entry.Attributes.Md5)
+ }
// Fallback: calculate ETag from chunks
return s3a.calculateETagFromChunks(entry.Chunks)
}