MCPcopy Create free account
hub / github.com/CopilotKit/aimock / resolveStrictMode

Function resolveStrictMode

src/helpers.ts:40–51  ·  view source on GitHub ↗
(
  serverDefault: boolean | undefined,
  rawHeaders?: IncomingHttpHeaders,
)

Source from the content-addressed store, hash-verified

38 * When absent or unrecognised, falls back to the server-level default.
39 */
40export function resolveStrictMode(
41 serverDefault: boolean | undefined,
42 rawHeaders?: IncomingHttpHeaders,
43): boolean {
44 if (rawHeaders) {
45 const header = rawHeaders["x-aimock-strict"];
46 const val = typeof header === "string" ? header : Array.isArray(header) ? header[0] : undefined;
47 if (val === "true" || val === "1") return true;
48 if (val === "false" || val === "0") return false;
49 }
50 return serverDefault ?? false;
51}
52
53/**
54 * Returns `true` or `false` when the X-AIMock-Strict header overrides the

Callers 15

handleVideoCreateFunction · 0.85
handleOllamaFunction · 0.85
handleOllamaGenerateFunction · 0.85
handleOllamaEmbeddingsFunction · 0.85
handleConverseFunction · 0.85
handleConverseStreamFunction · 0.85
handleCohereFunction · 0.85
handleCohereEmbedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…