Skip to content

Commit

Permalink
fix: path validation
Browse files Browse the repository at this point in the history
  • Loading branch information
rayriffy committed Feb 16, 2024
1 parent 2185ea6 commit 72e9068
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -64,7 +66,7 @@ const app = new Elysia()
}
},
params: t.Object({
page: t.Number(),
page: t.Numeric(),
}),
response: {
200: 'lotto.overview',
Expand Down

0 comments on commit 72e9068

Please sign in to comment.