Request crashes when not specifing "img" body parameter
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
When sending a request to`POST: /image-anaysis`, when the `img` attribute is not set in the request body, the request will crash.
```ts
router.post("/", upload.single("img"), async (req: Request, res: Response) => {
```
```
MulterError: Unexpected field
at wrappedFileFilter (/home/alexandre/Documents/cpnv/RIA2/RIA2_node/node_modules/multer/index.js:40:19)
at Busboy. (/home/alexandre/Documents/cpnv/RIA2/RIA2_node/node_modules/multer/lib/make-middleware.js:115:7)
at Busboy.emit (node:events:520:28)
at Busboy.emit (node:domain:475:12)
at Busboy.emit (/home/alexandre/Documents/cpnv/RIA2/RIA2_node/node_modules/busboy/lib/main.js:38:33)
at PartStream. (/home/alexandre/Documents/cpnv/RIA2/RIA2_node/node_modules/busboy/lib/types/multipart.js:213:13)
at PartStream.emit (node:events:520:28)
at PartStream.emit (node:domain:475:12)
at HeaderParser. (/home/alexandre/Documents/cpnv/RIA2/RIA2_node/node_modules/dicer/lib/Dicer.js:51:16)
at HeaderParser.emit (node:events:520:28)
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.