diff --git a/lib/routes/routeBackbeat.js b/lib/routes/routeBackbeat.js index aa2fb8afc9..08f6410dfa 100644 --- a/lib/routes/routeBackbeat.js +++ b/lib/routes/routeBackbeat.js @@ -472,13 +472,15 @@ function putMetadata(request, response, bucketInfo, objMd, log, callback) { omVal[headerName] = objMd[headerName]; }); } - // specify both 'versioning' and 'versionId' to create a "new" - // version (updating master as well) but with specified - // versionId - const options = { - versioning: bucketInfo.isVersioningEnabled(), - versionId: omVal.versionId, - }; + const options = {}; + if (omVal.versionId || omVal.replicationInfo.isNFS) { + // specify both 'versioning' and 'versionId' to create a "new" + // version (updating master as well) but with specified + // versionId + options.versioning = bucketInfo.isVersioningEnabled(); + options.versionId = omVal.versionId; + } + // If the object is from a source bucket without versioning (i.e. NFS), // then we want to create a version for the replica object even though // none was provided in the object metadata value. diff --git a/package.json b/package.json index 4798aeb849..160ef897ab 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zenko/cloudserver", - "version": "8.5.5", + "version": "8.5.8", "description": "Zenko CloudServer, an open-source Node.js implementation of a server handling the Amazon S3 protocol", "main": "index.js", "engines": {