From 72e906872eb0f28c4a30647142dae5af2901986c Mon Sep 17 00:00:00 2001 From: Phumrapee Limpianchop Date: Fri, 16 Feb 2024 23:51:36 +0900 Subject: [PATCH] fix: path validation --- src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 7ffdae5..a1d24db 100644 --- a/src/index.ts +++ b/src/index.ts @@ -55,6 +55,8 @@ const app = new Elysia() beforeHandle({ params, set }) { params.page = +params.page + console.log(params.page) + if (!Number.isSafeInteger(params.page)) { set.status = 400 return { @@ -64,7 +66,7 @@ const app = new Elysia() } }, params: t.Object({ - page: t.Number(), + page: t.Numeric(), }), response: { 200: 'lotto.overview',