MCPcopy Index your code
hub / github.com/anomalyco/opencode / cspForHtml

Function cspForHtml

packages/opencode/src/server/shared/ui.ts:19–22  ·  view source on GitHub ↗
(body: string)

Source from the content-addressed store, hash-verified

17}
18
19export function cspForHtml(body: string) {
20 const match = themePreloadHash(body)
21 return csp(match ? createHash("sha256").update(match[2]).digest("base64") : "")
22}
23
24function requestBody(request: HttpServerRequest.HttpServerRequest) {
25 if (request.method === "GET" || request.method === "HEAD") return HttpBody.empty

Callers 2

embeddedUIResponseFunction · 0.85
serveUIEffectFunction · 0.85

Calls 3

themePreloadHashFunction · 0.85
cspFunction · 0.85
updateMethod · 0.65

Tested by

no test coverage detected