(file: string, body: Uint8Array)
| 53 | } |
| 54 | |
| 55 | function 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 | |
| 64 | export function serveEmbeddedUIEffect( |
| 65 | requestPath: string, |
no test coverage detected