MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / serveAsset

Function serveAsset

telemetry-dashboard/src/index.ts:220–227  ·  view source on GitHub ↗

Gated static assets: the dashboard shell, its JS, its CSS, the chart library.

(env: Env, request: Request)

Source from the content-addressed store, hash-verified

218
219/** Gated static assets: the dashboard shell, its JS, its CSS, the chart library. */
220async function serveAsset(env: Env, request: Request): Promise<Response> {
221 const asset = await env.ASSETS.fetch(request);
222 const out = withSecurityHeaders(asset);
223 // Behind a session, so it must never land in a shared cache.
224 out.headers.set('cache-control', 'private, no-cache');
225 out.headers.set('vary', 'cookie');
226 return out;
227}
228
229export default {
230 async fetch(request, env): Promise<Response> {

Callers 1

fetchFunction · 0.85

Calls 2

withSecurityHeadersFunction · 0.85
setMethod · 0.45

Tested by

no test coverage detected