mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-12 05:14:37 +00:00
e5961336b7
Signed-off-by: David Mehren <dmehren1@gmail.com>
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)
|
|
}
|
|
}
|