mirror of
https://github.com/status-im/codimd.git
synced 2025-01-11 11:54:24 +00:00
dee77c459a
extract check URi is valid, redirect without trailing slashes
15 lines
279 B
JavaScript
15 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()
|
|
}
|