UNPKG

graphql-yoga

Version:
8 lines (7 loc) • 469 B
/** * Resolves the request id to use for correlating log lines, preferring a client-supplied * `x-request-id` header. Rejects values that are empty, too long, or contain control * characters (e.g. newlines), falling back to a generated id instead - the header is * attacker-controlled and gets embedded verbatim into every log line for the request. */ export declare function getRequestId(headerValue: string | null | undefined, generateId: () => string): string;