MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / readHeader

Function readHeader

src/ui-server/index.ts:382–386  ·  view source on GitHub ↗

Read a header as a single string (node gives arrays for some headers).

(req: http.IncomingMessage, name: string)

Source from the content-addressed store, hash-verified

380
381/** Read a header as a single string (node gives arrays for some headers). */
382function readHeader(req: http.IncomingMessage, name: string): string | undefined {
383 const value = req.headers[name];
384 if (value === undefined) return undefined;
385 return Array.isArray(value) ? value[0] : value;
386}
387
388/** Percent-decode for display; the raw value is used for anything security-relevant. */
389function safeDecode(value: string): string {

Callers 1

handleRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected