mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 23:14:24 +00:00
refactor: change errorTooLong function signature to avoid parameter passing error
Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
parent
35a2135b36
commit
8787177991
@ -45,7 +45,7 @@ function errorBadRequest (req, res) {
|
|||||||
responseError(res, '400', 'Bad Request', 'something not right.')
|
responseError(res, '400', 'Bad Request', 'something not right.')
|
||||||
}
|
}
|
||||||
|
|
||||||
function errorTooLong (res) {
|
function errorTooLong (req, res) {
|
||||||
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
|
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ function newNote (req, res, next) {
|
|||||||
var owner = null
|
var owner = null
|
||||||
var body = ''
|
var body = ''
|
||||||
if (req.body && req.body.length > config.documentMaxLength) {
|
if (req.body && req.body.length > config.documentMaxLength) {
|
||||||
return errorTooLong(res)
|
return errorTooLong(req, res)
|
||||||
} else if (req.body) {
|
} else if (req.body) {
|
||||||
body = req.body
|
body = req.body
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user