MCPcopy Index your code
hub / github.com/tiann/hapi / readHookToken

Function readHookToken

cli/src/opencode/utils/startOpencodeHookServer.ts:17–23  ·  view source on GitHub ↗
(req: IncomingMessage)

Source from the content-addressed store, hash-verified

15}
16
17function readHookToken(req: IncomingMessage): string | null {
18 const header = req.headers['x-hapi-hook-token'];
19 if (Array.isArray(header)) {
20 return header[0] ?? null;
21 }
22 return header ?? null;
23}
24
25export async function startOpencodeHookServer(options: OpencodeHookServerOptions): Promise<OpencodeHookServer> {
26 const hookToken = options.token || randomBytes(16).toString('hex');

Callers 1

startOpencodeHookServerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected