MCPcopy
hub / github.com/scality/cloudserver / newPutObjectRequest

Function newPutObjectRequest

tests/unit/api/objectCopy.js:513–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511 const putSourceObjectRequest = versioningTestUtils.createPutObjectRequest(
512 sourceBucketName, objectKey, objData[0]);
513 const newPutObjectRequest = params => {
514 const { location } = params || {};
515 const r = _createObjectCopyRequest(destBucketName);
516 if (location) {
517 r.headers[objectLocationConstraintHeader] = location;
518
519 // Need to 'replace' the metadata for the constraint to be taken into account
520 r.headers['x-amz-metadata-directive'] = 'REPLACE';
521 }
522 return r;
523 };
524
525 it('should use the versionID from the backend', done => {
526 const versionID = versioning.VersionID.encode(versioning.VersionID.generateVersionId('0', ''));

Callers 1

objectCopy.jsFile · 0.70

Calls 1

_createObjectCopyRequestFunction · 0.70

Tested by

no test coverage detected