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

Function addGenerationIdHeader

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

Source from the content-addressed store, hash-verified

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

Callers 1

fetchAdRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected