MCPcopy Create free account
hub / github.com/dailydotdev/apps / addGenerationIdHeader

Function addGenerationIdHeader

packages/shared/src/lib/ads.ts:135–156  ·  view source on GitHub ↗
({
  ad,
  res,
}: {
  ad: Ad | null;
  res: Response;
})

Source from the content-addressed store, hash-verified

133const skadiGenerationIdHeader = 'x-generation-id';
134
135const addGenerationIdHeader = ({
136 ad,
137 res,
138}: {
139 ad: Ad | null;
140 res: Response;
141}): Ad | null => {
142 if (!ad) {
143 return ad;
144 }
145
146 const generationId = res.headers.get(skadiGenerationIdHeader);
147
148 if (!generationId) {
149 return ad;
150 }
151
152 return {
153 ...ad,
154 generationId,
155 };
156};
157
158const fetchAdRequest = async ({
159 path,

Callers 1

fetchAdRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected