diff options
author | Sheogorath | 2019-11-20 20:07:35 +0100 |
---|---|---|
committer | GitHub | 2019-11-20 20:07:35 +0100 |
commit | 689f5a0a9583fdd774a271a9e6265ee5356d72a0 (patch) | |
tree | 754bed08f4724a4bc4f91743f6dfe12f92857c01 /lib/web/middleware | |
parent | f894d3c2fa29865288a31cd80cd2a772ce44b330 (diff) | |
parent | b5ccceff59002034fbb089935076f40b8aa16e58 (diff) |
Merge pull request #213 from davidmehren/refactor_backend_notes
First steps in refactoring the backend code
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() } |