Skip to content

Commit

Permalink
perf: set json body limit to 100kb
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Oct 19, 2024
1 parent 1ba5fae commit 2dfb6ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib/http/middleware/body-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import createHttpError from 'http-errors';
import koaBodyParser from 'koa-bodyparser';

export const bodyParser = () => koaBodyParser({
enableTypes: [ 'json' ],
jsonLimit: '100kb',
onerror (error) {
throw createHttpError(400, error.message);
},
Expand Down

0 comments on commit 2dfb6ef

Please sign in to comment.