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

Function getUserMetadata

lib/api/objectGetAttributes.js:41–51  ·  view source on GitHub ↗

* getUserMetadata - Retrieves all object user metadata * @param {object} objMD - object metadata * @returns {object} - user metadata key-value pairs

(objMD)

Source from the content-addressed store, hash-verified

39 * @returns {object} - user metadata key-value pairs
40 */
41function getUserMetadata(objMD) {
42 const metadata = {};
43
44 for (const key in objMD) {
45 if (key.startsWith('x-amz-meta-')) {
46 metadata[key] = objMD[key];
47 }
48 }
49
50 return metadata;
51}
52
53/**
54 * objectGetAttributes - Retrieves all metadata from an object without returning the object itself

Callers 1

buildXmlResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected