diff options
author | David Mehren | 2019-10-27 13:51:53 +0100 |
---|---|---|
committer | David Mehren | 2019-10-27 13:51:53 +0100 |
commit | f78540c3fbf109d6ccf2d92c5b1cf0148c88f722 (patch) | |
tree | 7f8b968b925b8b262cca0f4cd180027abc4b745e /lib/web/middleware | |
parent | 20a67e3446723231961043bffeb5a7b974e891c0 (diff) |
Move note actions to their own file.
Because of circular import problems, this commit also moves the error messages from response.js to errors.js
Signed-off-by: David Mehren <dmehren1@gmail.com>
Diffstat (limited to 'lib/web/middleware')
-rw-r--r-- | lib/web/middleware/checkURIValid.js | 4 | ||||
-rw-r--r-- | lib/web/middleware/tooBusy.js | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/web/middleware/checkURIValid.js b/lib/web/middleware/checkURIValid.js index 88065e79..cd6dabd2 100644 --- a/lib/web/middleware/checkURIValid.js +++ b/lib/web/middleware/checkURIValid.js @@ -1,14 +1,14 @@ 'use strict' const logger = require('../../logger') -const response = require('../../response') +const errors = require('../../errors') module.exports = function (req, res, next) { try { decodeURIComponent(req.path) } catch (err) { logger.error(err) - return response.errorBadRequest(res) + return errors.errorBadRequest(res) } next() } diff --git a/lib/web/middleware/tooBusy.js b/lib/web/middleware/tooBusy.js index 49efbe37..a2101975 100644 --- a/lib/web/middleware/tooBusy.js +++ b/lib/web/middleware/tooBusy.js @@ -2,14 +2,14 @@ const toobusy = require('toobusy-js') -const response = require('../../response') +const errors = require('../../errors') const config = require('../../config') toobusy.maxLag(config.tooBusyLag) module.exports = function (req, res, next) { if (toobusy()) { - response.errorServiceUnavailable(res) + errors.errorServiceUnavailable(res) } else { next() } |