MCPcopy Index your code
hub / github.com/scality/cloudserver / createHeaders

Function createHeaders

lib/utilities/request.js:19–31  ·  view source on GitHub ↗
(headers)

Source from the content-addressed store, hash-verified

17 * will be ignored if a value has been set for theirlower-cased form
18 */
19function createHeaders(headers) {
20 if (typeof headers !== 'object') {
21 return {};
22 }
23 const out = {};
24 Object.entries(headers).forEach(([key, value]) => {
25 const lowKey = key.toLowerCase();
26 if (out[lowKey] === undefined) {
27 out[lowKey] = value;
28 }
29 });
30 return out;
31}
32
33/**
34 * @param {url.URL | string} endpoint -

Callers 1

requestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected