Caleb: solve for typechecking on idempotencyKey on my machine

This commit is contained in:
Caleb Peffer 2024-06-18 17:07:38 -07:00
parent 32dde257a5
commit 5a91d8425f
1 changed files with 6 additions and 4 deletions

View File

@ -10,7 +10,9 @@ export async function validateIdempotencyKey(
// // not returning for missing idempotency key for now // // not returning for missing idempotency key for now
return true; return true;
} }
if (!isUuid(idempotencyKey)) { // Ensure idempotencyKey is treated as a string
const key = Array.isArray(idempotencyKey) ? idempotencyKey[0] : idempotencyKey;
if (!isUuid(key)) {
console.error("Invalid idempotency key provided in the request headers."); console.error("Invalid idempotency key provided in the request headers.");
return false; return false;
} }