fix: accept request body only if string
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
e7327afbae
commit
d856c0acb5
@ -85,7 +85,7 @@ exports.createFromPOST = function (req, res, next) {
|
|||||||
let body = ''
|
let body = ''
|
||||||
if (req.body && req.body.length > config.documentMaxLength) {
|
if (req.body && req.body.length > config.documentMaxLength) {
|
||||||
return errors.errorTooLong(res)
|
return errors.errorTooLong(res)
|
||||||
} else if (req.body) {
|
} else if (typeof req.body === 'string') {
|
||||||
body = req.body
|
body = req.body
|
||||||
}
|
}
|
||||||
body = body.replace(/[\r]/g, '')
|
body = body.replace(/[\r]/g, '')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user