From 878717799107e2be40dc432fa92aab3029ca0bd2 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Wed, 26 Feb 2020 11:23:55 +0800 Subject: [PATCH] refactor: change errorTooLong function signature to avoid parameter passing error Signed-off-by: BoHong Li --- lib/response.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/response.js b/lib/response.js index 66c063e6..1e681558 100644 --- a/lib/response.js +++ b/lib/response.js @@ -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 }