mirror of https://github.com/status-im/codimd.git
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.')
|
||||
}
|
||||
|
||||
function errorTooLong (res) {
|
||||
function errorTooLong (req, res) {
|
||||
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ function newNote (req, res, next) {
|
|||
var owner = null
|
||||
var body = ''
|
||||
if (req.body && req.body.length > config.documentMaxLength) {
|
||||
return errorTooLong(res)
|
||||
return errorTooLong(req, res)
|
||||
} else if (req.body) {
|
||||
body = req.body
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue