codimd/lib/middleware/checkURIValid.ts
Raccoon 6f93e43978
move app.js to lib/
update

Signed-off-by: Raccoon <raccoon@hackmd.io>
2021-06-16 18:35:31 +08:00

13 lines
263 B
TypeScript

import * as logger from '../logger'
import * as response from "../response";
export default function (req, res, next) {
try {
decodeURIComponent(req.path)
} catch (err) {
logger.error(err)
return response.errorBadRequest(req, res)
}
next()
}