Compare commits

...

1 Commits

Author SHA1 Message Date
Jonathan Gramain fde4b088a3 ZENKO-1420 move getUserMetadata() helper from backbeat ObjectQueueEntry to ObjectMD 2019-02-04 12:09:55 -08:00
1 changed files with 14 additions and 0 deletions

View File

@ -702,6 +702,20 @@ class ObjectMD {
return this._data.tags; return this._data.tags;
} }
getUserMetadata() {
const metaHeaders = {};
const data = this.getValue();
Object.keys(data).forEach(key => {
if (key.startsWith('x-amz-meta-')) {
metaHeaders[key] = data[key];
}
});
if (Object.keys(metaHeaders).length > 0) {
return JSON.stringify(metaHeaders);
}
return undefined;
}
/** /**
* Set replication information * Set replication information
* *