Skip to content

setDebugHeader

setDebugHeader(c, name, value): void

Defined in: src/policies/sdk/helpers.ts:146

Set a debug header value for client-requested debug output.

Policies call this to contribute debug data. The value is only stored if the client requested it via the x-stoma-debug request header AND the gateway has debug headers enabled. When neither condition is met, this is a no-op (single Map lookup).

Context

Hono request context.

string

Header name (e.g. "x-stoma-cache-key").

Header value. Numbers and booleans are stringified.

string | number | boolean

void

setDebugHeader(c, "x-stoma-cache-key", key);
setDebugHeader(c, "x-stoma-cache-ttl", resolved.ttlSeconds);