fix: accept request body only if string

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2023-07-18 21:36:56 +02:00
parent e7327afbae
commit d856c0acb5

View file

@ -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, '')