ensure extension during rename and delete (#1508)

This commit is contained in:
Alex Christoffer Rasmussen
2025-02-18 21:25:36 +01:00
committed by GitHub
parent a5afb32b8a
commit 1f6f3df0f2
+2 -1
View File
@@ -133,7 +133,8 @@ export const validateFilenameParam = [
.customSanitizer((input: string) => sanitize(input))
.withMessage('Failed to sanitize the filename')
.notEmpty()
.withMessage('Filename was empty or contained only invalid characters'),
.withMessage('Filename was empty or contained only invalid characters')
.customSanitizer((input: string) => ensureJsonExtension(input)),
(req: Request, res: Response, next: NextFunction) => {
const errors = validationResult(req);