mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-25 03:06:31 -05: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()
|
|
}
|