Throw 400 on file upload with missing filename (#12785)

Fixes #8101
This commit is contained in:
Rijk van Zanten
2022-04-15 17:36:42 -04:00
committed by GitHub
parent c0c32a9e99
commit d8b81f07c7
2 changed files with 31 additions and 0 deletions

View File

@@ -62,6 +62,10 @@ export const multipartHandler: RequestHandler = (req, res, next) => {
});
busboy.on('file', async (fieldname, fileStream, filename, encoding, mimetype) => {
if (!filename) {
return busboy.emit('error', new InvalidPayloadException(`File is missing filename`));
}
fileCount++;
if (!payload.title) {