From 143a3caf115b0a9646bc1b4fd2a8ce3bc4789caa Mon Sep 17 00:00:00 2001 From: Leandro Facchinetti Date: Thu, 9 Jan 2025 14:26:19 +0000 Subject: [PATCH] --- source/index.mts | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/source/index.mts b/source/index.mts index 3528078..b6c284d 100644 --- a/source/index.mts +++ b/source/index.mts @@ -809,7 +809,7 @@ application.server?.push({ ) => { if ( typeof request.body.title !== "string" || - request.body.title === "" || + request.body.title.trim() === "" || request.body.title.length > 200 ) throw "validation"; @@ -1115,16 +1115,18 @@ application.server?.push({ if ( typeof request.body.title !== "string" || request.body.title.trim() === "" || + request.body.title.length > 200 || typeof request.body.icon !== "string" || (request.body.icon.trim() !== "" && - (() => { - try { - new URL(request.body.icon); - return false; - } catch { - return true; - } - })()) + (request.body.icon.length > 200 || + (() => { + try { + new URL(request.body.icon); + return false; + } catch { + return true; + } + })())) ) throw "validation"; application.database.run(