hedgedoc/lib/web/middleware/checkURIValid.js
David Mehren f78540c3fb
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>
2019-10-27 13:51:53 +01:00

14 lines
273 B
JavaScript

'use strict'
const logger = require('../../logger')
const errors = require('../../errors')
module.exports = function (req, res, next) {
try {
decodeURIComponent(req.path)
} catch (err) {
logger.error(err)
return errors.errorBadRequest(res)
}
next()
}