From 062ecf406f0c468761765829825e04d2530fe5d5 Mon Sep 17 00:00:00 2001 From: Maxime Cannoodt Date: Wed, 10 Aug 2022 09:27:30 +0200 Subject: [PATCH] fix: :bug: fix upload limit not working correctly --- server/src/app.ts | 2 +- server/src/controllers/note/note.router.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/app.ts b/server/src/app.ts index 5394e84..c10280e 100644 --- a/server/src/app.ts +++ b/server/src/app.ts @@ -10,7 +10,7 @@ import { cleanExpiredNotes, cleanInterval } from "./tasks/deleteExpiredNotes"; export const app: Express = express(); // Enable JSON body parsing -app.use(express.json({ limit: "500k" })); +app.use(express.json({})); // configure logging app.use( diff --git a/server/src/controllers/note/note.router.ts b/server/src/controllers/note/note.router.ts index bf71da3..180e3e4 100644 --- a/server/src/controllers/note/note.router.ts +++ b/server/src/controllers/note/note.router.ts @@ -21,6 +21,7 @@ const getRateLimit = rateLimit({ legacyHeaders: false, // Disable the `X-RateLimit-*` headers }); +// notesRoute.use(jsonParser, uploadLimit); notesRoute.use(jsonParser); notesRoute.post("", postRateLimit, postNoteController); notesRoute.get("/:id", getRateLimit, getNoteController);