Skip to content

Commit

Permalink
ensure extension during rename and delete (#1508)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-Arc authored Feb 18, 2025
1 parent a5afb32 commit 1f6f3df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/server/src/api-data/db/db.validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1f6f3df

Please sign in to comment.