From 2d858bece4aad3833eef781ea11608a7e016ba35 Mon Sep 17 00:00:00 2001 From: Miodec Date: Thu, 29 Jun 2023 13:43:48 +0200 Subject: [PATCH] stricter schema --- backend/src/api/routes/quotes.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/src/api/routes/quotes.ts b/backend/src/api/routes/quotes.ts index 465d90d71..1ca025f41 100644 --- a/backend/src/api/routes/quotes.ts +++ b/backend/src/api/routes/quotes.ts @@ -108,6 +108,7 @@ router.post( language: joi .string() .regex(/^[\w+]+$/) + .max(50) .required(), }, }), @@ -131,7 +132,10 @@ router.post( validateRequest({ body: { quoteId: withCustomMessages.regex(/\d+/).required(), - quoteLanguage: withCustomMessages.regex(/^[\w+]+$/).required(), + quoteLanguage: withCustomMessages + .regex(/^[\w+]+$/) + .max(50) + .required(), reason: joi .string() .valid(