mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-29 21:24:29 -05:00
dee77c459a
extract check URi is valid, redirect without trailing slashes
14 lines
279 B
JavaScript
14 lines
279 B
JavaScript
'use strict'
|
|
|
|
const logger = require('../../logger')
|
|
const response = require('../../response')
|
|
|
|
module.exports = function (req, res, next) {
|
|
try {
|
|
decodeURIComponent(req.path)
|
|
} catch (err) {
|
|
logger.error(err)
|
|
return response.errorBadRequest(res)
|
|
}
|
|
next()
|
|
}
|