mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-29 14:41:54 +00:00
f78540c3fb
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>
14 lines
273 B
JavaScript
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()
|
|
}
|