MCPcopy Create free account
hub / github.com/anomalyco/opencode / embeddedUIResponse

Function embeddedUIResponse

packages/opencode/src/server/shared/ui.ts:55–62  ·  view source on GitHub ↗
(file: string, body: Uint8Array)

Source from the content-addressed store, hash-verified

53}
54
55function embeddedUIResponse(file: string, body: Uint8Array) {
56 const mime = FSUtil.mimeType(file)
57 const headers = new Headers({ "content-type": mime })
58 if (mime.startsWith("text/html")) {
59 headers.set("content-security-policy", cspForHtml(new TextDecoder().decode(body)))
60 }
61 return HttpServerResponse.raw(body, { headers })
62}
63
64export function serveEmbeddedUIEffect(
65 requestPath: string,

Callers 1

serveEmbeddedUIEffectFunction · 0.85

Calls 3

cspForHtmlFunction · 0.85
setMethod · 0.45
rawMethod · 0.45

Tested by

no test coverage detected