Function: appendCmcdHeaders()
ts
function appendCmcdHeaders(
headers,
cmcd,
options?
): Record<string, string>;Defined in: appendCmcdHeaders.ts:21
Append CMCD header shards to a header object.
Parameters
headers
Record<string, string>
The headers to append to.
cmcd
The CMCD object to append.
options?
Options for encoding.
Returns
Record<string, string>
The headers with CMCD header shards appended.
Example
ts
const headers = {
hello: 'world',
}
const data = {
br: [1000],
}
deepEqual(appendCmcdHeaders(headers, data), {
hello: 'world',
['CMCD-Object']: 'br=(1000)',
['CMCD-Session']: 'v=2',
})