| 202 | "worker-src 'self' blob:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'\r\n" |
| 203 | |
| 204 | static bool serve_embedded(cbm_http_conn_t *c, const char *path) { |
| 205 | const cbm_embedded_file_t *f = cbm_embedded_lookup(path); |
| 206 | if (!f) |
| 207 | return false; |
| 208 | |
| 209 | /* Build headers with correct Content-Type for this asset */ |
| 210 | char hdrs[1024]; |
| 211 | snprintf(hdrs, sizeof(hdrs), |
| 212 | "%sContent-Type: %s\r\n" |
| 213 | "Cache-Control: public, max-age=31536000, immutable\r\n" |
| 214 | "X-Content-Type-Options: nosniff\r\n" CBM_UI_CSP, |
| 215 | g_cors, f->content_type); |
| 216 | |
| 217 | cbm_http_reply_buf(c, 200, hdrs, f->data, (size_t)f->size); |
| 218 | return true; |
| 219 | } |
| 220 | |
| 221 | /* Build DB path for a project: <cache_dir>/<project>.db */ |
| 222 | static void db_path_for_project(const char *project, char *buf, size_t bufsz) { |
no test coverage detected