Pentest 70.2 (LOW): 500 statt 415 bei verbotenem MIME
Globaler Error-Handler (index.ts:461) matcht /sind erlaubt|nicht erlaubt/i auf 415. Die 70.1-Reject-Message "... WebP erlaubt" (ohne "sind") rutschte durch und landete bei 500 + Error-Log-Spam. Fix: "... WebP-Dateien sind erlaubt" macht den Regex happy. Andere Routes nutzen alle schon dieselbe Phrase.
This commit is contained in:
@@ -29,7 +29,7 @@ const docUpload = multer({
|
||||
// Magic-Byte-Check in validateUploadedFile.
|
||||
const allowed = ['application/pdf', 'image/jpeg', 'image/jpg', 'image/png', 'image/gif', 'image/webp'];
|
||||
if (allowed.includes(file.mimetype)) cb(null, true);
|
||||
else cb(new Error('Nur PDF, JPG, PNG, GIF oder WebP erlaubt'));
|
||||
else cb(new Error('Nur PDF, JPG, PNG, GIF oder WebP-Dateien sind erlaubt'));
|
||||
},
|
||||
limits: { fileSize: 10 * 1024 * 1024 },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user