feat: integrate platform backend and application interfaces
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
|
||||
export function requestIdFrom(request: { headers: Record<string, string | string[] | undefined> }) {
|
||||
const header = request.headers["x-request-id"];
|
||||
return typeof header === "string" && /^[a-zA-Z0-9._:-]{8,128}$/.test(header) ? header : randomUUID();
|
||||
}
|
||||
Reference in New Issue
Block a user