Compare commits

...

1 Commits

Author SHA1 Message Date
philipyoo 1ac5d37017 delete-marker set user md 2019-04-16 09:24:09 -07:00
1 changed files with 15 additions and 0 deletions

View File

@ -19,6 +19,21 @@ const { externalBackends, versioningNotImplBackends } = constants;
const externalVersioningErrorMessage = 'We do not currently support putting ' + const externalVersioningErrorMessage = 'We do not currently support putting ' +
'a versioned object to a location-constraint of type Azure.'; 'a versioned object to a location-constraint of type Azure.';
// if receiving a request from Zenko, we place a user-metadata
// field on the object, including delete markers
function _placeZenkoStamp(request, metaHeaders, isDeleteMarker) {
const zenkoIdentifierHeader = 'x-amz-meta-zenko-source';
const userAgent = request.headers['user-agent'];
// if the request came from Zenko, add user-metadata on this delete marker
// for internal use
if (isDeleteMarker) {
if (userAgent && userAgent.includes('Zenko')) {
// eslint-disable-next-line no-param-reassign
metaHeaders[zenkoIdentifierHeader] = 'zenko';
}
}
}
function _storeInMDandDeleteData(bucketName, dataGetInfo, cipherBundle, function _storeInMDandDeleteData(bucketName, dataGetInfo, cipherBundle,
metadataStoreParams, dataToDelete, deleteLog, requestMethod, callback) { metadataStoreParams, dataToDelete, deleteLog, requestMethod, callback) {