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

Function buildXmlResponse

lib/api/objectGetAttributes.js:22–33  ·  view source on GitHub ↗

* buildXmlResponse - Build XML response for GetObjectAttributes * @param {object} objMD - object metadata * @param {Set } requestedAttrs - set of requested attribute names * @returns {string} XML response

(objMD, requestedAttrs)

Source from the content-addressed store, hash-verified

20 * @returns {string} XML response
21 */
22function buildXmlResponse(objMD, requestedAttrs) {
23 const xml = [
24 '<?xml version="1.0" encoding="UTF-8"?>',
25 '<GetObjectAttributesResponse>',
26 ];
27
28 const userMetadata = getUserMetadata(objMD);
29 buildAttributesXml(objMD, userMetadata, requestedAttrs, xml);
30
31 xml.push('</GetObjectAttributesResponse>');
32 return xml.join('');
33}
34
35
36/**

Callers 1

objectGetAttributesFunction · 0.85

Calls 2

getUserMetadataFunction · 0.85
buildAttributesXmlFunction · 0.85

Tested by

no test coverage detected