MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / readHeader

Function readHeader

packages/plugins/mcp/src/sdk/probe-shape.ts:60–68  ·  view source on GitHub ↗
(headers: Readonly<Record<string, string>>, name: string)

Source from the content-addressed store, hash-verified

58 * `Response.headers` already lower-cases, but we normalise explicitly
59 * to stay robust against test mocks that construct `Headers` loosely. */
60const readHeader = (headers: Readonly<Record<string, string>>, name: string): string | null => {
61 const direct = headers[name];
62 if (direct !== undefined) return direct;
63 const lower = name.toLowerCase();
64 for (const [k, v] of Object.entries(headers)) {
65 if (k.toLowerCase() === lower) return v;
66 }
67 return null;
68};
69
70class ProbeTransportError extends Data.TaggedError("ProbeTransportError")<{
71 readonly reason: string;

Callers 1

classifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected