mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-12-18 18:57:32 -05:00
7b9f9a487b
Signed-off-by: David Mehren <git@herrmehren.de>
13 lines
348 B
TypeScript
13 lines
348 B
TypeScript
import { logger } from '../../logger'
|
|
import { errors } from '../../errors'
|
|
import { NextFunction, Request, Response } from 'express'
|
|
|
|
export function checkURI (req: Request, res: Response, next: NextFunction): void {
|
|
try {
|
|
decodeURIComponent(req.path)
|
|
next()
|
|
} catch (err) {
|
|
logger.error(err)
|
|
errors.errorBadRequest(res)
|
|
}
|
|
}
|