From 0706b1512e2d9ac34be6654c519eaca0116ddd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20DONNART?= Date: Fri, 11 Sep 2026 14:19:50 +0200 Subject: [PATCH 1/2] Report scal-replica for replicas without the isReplica flag The isReplica field was introduced in 9.4 with no metadata migration, so objects replicated before the upgrade only carry the legacy encoding status === 'REPLICA' and never got the x-amz-meta-scal-replica header. Accept both encodings, same semantics as arsenal ObjectMD.getReplicationIsReplica(). Issue: CLDSRV-994 --- lib/utilities/collectResponseHeaders.js | 2 +- tests/unit/utils/collectResponseHeaders.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/utilities/collectResponseHeaders.js b/lib/utilities/collectResponseHeaders.js index 99f3b6bba3..6969b3cb8c 100644 --- a/lib/utilities/collectResponseHeaders.js +++ b/lib/utilities/collectResponseHeaders.js @@ -91,7 +91,7 @@ function collectResponseHeaders(objectMD, corsHeaders, versioningCfg, returnTagC } if (objectMD.replicationInfo) { const { isReplica, status } = objectMD.replicationInfo; - if (isReplica) { + if (isReplica || status === 'REPLICA') { const hasReplicated = !status || status === 'COMPLETED'; responseMetaHeaders['x-amz-replication-status'] = hasReplicated ? 'REPLICA' : status; responseMetaHeaders['x-amz-meta-scal-replica'] = 'true'; diff --git a/tests/unit/utils/collectResponseHeaders.js b/tests/unit/utils/collectResponseHeaders.js index 5dd59103ba..75e26e66f2 100644 --- a/tests/unit/utils/collectResponseHeaders.js +++ b/tests/unit/utils/collectResponseHeaders.js @@ -17,6 +17,13 @@ describe('Middleware: Collect Response Headers', () => { assert.deepStrictEqual(headers['x-amz-meta-scal-replica'], 'true'); }); + it('should mark a replica written without the isReplica flag', () => { + const objectMD = { replicationInfo: { status: 'REPLICA' } }; + const headers = collectResponseHeaders(objectMD); + assert.deepStrictEqual(headers['x-amz-replication-status'], 'REPLICA'); + assert.deepStrictEqual(headers['x-amz-meta-scal-replica'], 'true'); + }); + it('should default to REPLICA when isReplica is true and status is absent', () => { const objectMD = { replicationInfo: { isReplica: true } }; const headers = collectResponseHeaders(objectMD); From c39c0021479b3187d0c3dca03563d878c1f37d11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20DONNART?= Date: Fri, 11 Sep 2026 17:54:36 +0200 Subject: [PATCH 2/2] Bump package.json to 9.4.4 Issue: CLDSRV-944 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5fb4b68aea..a79cc3e702 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenko/cloudserver", - "version": "9.4.3", + "version": "9.4.4", "description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol", "main": "index.js", "engines": {