feat(api): add per-type file size limits and 413 responses for media uploads
- FileValidationPipe now supports maxSizeByMimeType for per-MIME-type size limits - Images: max 10MB, Video (MP4): max 100MB - Oversized files return 413 Payload Too Large instead of 400 Bad Request - MIME type validation runs before size check for clearer error messages - Multer module limit raised to 100MB (per-type enforcement in pipe) - Added 413 ApiResponse to Swagger docs on upload endpoint - Added comprehensive unit tests for FileValidationPipe (16 test cases) Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -37,7 +37,7 @@ const QueryHandlers = [
|
||||
imports: [
|
||||
CqrsModule,
|
||||
MulterModule.register({
|
||||
limits: { fileSize: 10 * 1024 * 1024 }, // 10 MB
|
||||
limits: { fileSize: 100 * 1024 * 1024 }, // 100 MB — per-type limits enforced by FileValidationPipe
|
||||
}),
|
||||
],
|
||||
controllers: [ListingsController],
|
||||
|
||||
Reference in New Issue
Block a user