From d856c0acb5b3a0be06b8fc1fba3d75a2116b14a2 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Tue, 18 Jul 2023 21:36:56 +0200 Subject: [PATCH] fix: accept request body only if string Signed-off-by: Tilman Vatteroth --- lib/web/note/controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/web/note/controller.js b/lib/web/note/controller.js index 9b943c57..6626782e 100644 --- a/lib/web/note/controller.js +++ b/lib/web/note/controller.js @@ -85,7 +85,7 @@ exports.createFromPOST = function (req, res, next) { let body = '' if (req.body && req.body.length > config.documentMaxLength) { return errors.errorTooLong(res) - } else if (req.body) { + } else if (typeof req.body === 'string') { body = req.body } body = body.replace(/[\r]/g, '')