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

Function readHeader

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

Source from the content-addressed store, hash-verified

76 * `Response.headers` already lower-cases, but we normalise explicitly
77 * to stay robust against test mocks that construct `Headers` loosely. */
78const readHeader = (headers: Readonly<Record<string, string>>, name: string): string | null => {
79 const direct = headers[name];
80 if (direct !== undefined) return direct;
81 const lower = name.toLowerCase();
82 for (const [k, v] of Object.entries(headers)) {
83 if (k.toLowerCase() === lower) return v;
84 }
85 return null;
86};
87
88/** Statuses that mean "you are not authenticated for this resource".
89 *

Callers 1

classifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected