fix: resolve CORS TypeScript error and format server files
Type defaultCorsOptions as CorsOptions so allowedHeaders is compatible with the cors middleware. Format files from develop merge for CI.
This commit is contained in:
1 parent
33f8641f3a
commit
ef049b6521
4 files changed
+13
-9
No files matched your search
@@ -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) => {
|
||||
|
||||
Reference in new issue
Block a user