Skip to content

Commit 8787177

Browse files
committed
refactor: change errorTooLong function signature to avoid parameter passing error
Signed-off-by: BoHong Li <[email protected]>
1 parent 35a2135 commit 8787177

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/response.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function errorBadRequest (req, res) {
4545
responseError(res, '400', 'Bad Request', 'something not right.')
4646
}
4747

48-
function errorTooLong (res) {
48+
function errorTooLong (req, res) {
4949
responseError(res, '413', 'Payload Too Large', 'Shorten your note!')
5050
}
5151

@@ -91,7 +91,7 @@ function newNote (req, res, next) {
9191
var owner = null
9292
var body = ''
9393
if (req.body && req.body.length > config.documentMaxLength) {
94-
return errorTooLong(res)
94+
return errorTooLong(req, res)
9595
} else if (req.body) {
9696
body = req.body
9797
}

0 commit comments

Comments
 (0)