MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / serve_embedded

Function serve_embedded

src/ui/http_server.c:164–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 "worker-src 'self' blob:; object-src 'none'; base-uri 'none'; frame-ancestors 'none'\r\n"
163
164static bool serve_embedded(cbm_http_conn_t *c, const char *path) {
165 const cbm_embedded_file_t *f = cbm_embedded_lookup(path);
166 if (!f)
167 return false;
168
169 /* Build headers with correct Content-Type for this asset */
170 char hdrs[1024];
171 snprintf(hdrs, sizeof(hdrs),
172 "%sContent-Type: %s\r\n"
173 "Cache-Control: public, max-age=31536000, immutable\r\n" CBM_UI_CSP,
174 g_cors, f->content_type);
175
176 cbm_http_reply_buf(c, 200, hdrs, f->data, (size_t)f->size);
177 return true;
178}
179
180/* Build DB path for a project: <cache_dir>/<project>.db */
181static void db_path_for_project(const char *project, char *buf, size_t bufsz) {

Callers 1

dispatch_requestFunction · 0.85

Calls 2

cbm_embedded_lookupFunction · 0.85
cbm_http_reply_bufFunction · 0.85

Tested by

no test coverage detected