Download packages/kap-server/src/request-id.ts from SaylorTwift/kimi-code: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/request-id.ts
- Command line
-
hf download hf://SaylorTwift/kimi-code/packages/kap-server/src/request-id.ts
-
curl -L -o request-id.ts https://huggingface.co/SaylorTwift/kimi-code/resolve/main/packages/kap-server/src/request-id.ts
357 Bytes
| import { parseOrGenerateRequestId } from './protocol/request-id'; | |
| const REQUEST_ID_HEADER = 'x-request-id'; | |
| export function resolveRequestId( | |
| headers: Record<string, string | string[] | undefined>, | |
| ): string { | |
| const raw = headers[REQUEST_ID_HEADER]; | |
| const supplied = Array.isArray(raw) ? raw[0] : raw; | |
| return parseOrGenerateRequestId(supplied); | |
| } | |