This commit is contained in:
Alex Holliday committed 2026-06-17 09:45:59 -07:00
1 parent 64b8aab4d6
commit f65238da6c
4 files changed
+11 -7

No files matched your search

+2 -3
View File
@@ -6,10 +6,9 @@ import { AppError } from "../../../src/utils/AppError.ts";
// Reaches into the multer instance config to exercise the fileFilter/limits in isolation.
// Guards against regressing GHSA-9xvg-x28f-m78m (pre-auth DoS via unbounded uploads).
const config = (imageUpload as unknown as { fileFilter: Function; limits: { fileSize: number; files: number } });
const config = imageUpload as unknown as { fileFilter: Function; limits: { fileSize: number; files: number } };
const makeFile = (mimetype: string): Express.Multer.File =>
({ fieldname: "profileImage", originalname: "x", mimetype }) as Express.Multer.File;
const makeFile = (mimetype: string): Express.Multer.File => ({ fieldname: "profileImage", originalname: "x", mimetype }) as Express.Multer.File;
const runFilter = (mimetype: string): Promise<{ error: unknown; accepted: unknown }> =>
new Promise((resolve) => {