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

Function copy_header_value

src/ui/httpd.c:442–455  ·  view source on GitHub ↗

Copy a trimmed header value into out. Oversize security headers are rejected, * never silently converted into an apparently absent header. */

Source from the content-addressed store, hash-verified

440/* Copy a trimmed header value into out. Oversize security headers are rejected,
441 * never silently converted into an apparently absent header. */
442static bool copy_header_value(const char *val, const char *val_end, char *out, size_t outsz) {
443 while (val < val_end && (*val == ' ' || *val == '\t'))
444 val++;
445 while (val_end > val && (val_end[-1] == ' ' || val_end[-1] == '\t'))
446 val_end--;
447 size_t n = (size_t)(val_end - val);
448 if (n >= outsz) {
449 out[0] = '\0';
450 return false;
451 }
452 memcpy(out, val, n);
453 out[n] = '\0';
454 return true;
455}
456
457int cbm_http_parse_head(const char *data, size_t len, cbm_http_req_t *req, size_t *body_offset,
458 size_t *content_length) {

Callers 1

cbm_http_parse_headFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected