podkrepi-bg / api

Nest.js REST backend for charity platform Podkrepi.bg https://podkrepi.bg/swagger
https://podkrepi.bg
MIT License
82 stars 44 forks source link

File upload stays pending for unacceptable file extensions (localhost and dev.podkrepi.bg) #668

Open gparlakov opened 1 week ago

gparlakov commented 1 week ago

Which area(s) of Podkrepi.bg are affected? (leave empty if unsure)

Storage

Describe the Bug

When uploading a file that is not acceptable (function validateFileType() from files.ts deems it so and calls the cb) the request remains pending forever

To Reproduce

  1. Visit /admin/campaigns/create
  2. Fill in form
  3. Add a .exe file for the files
  4. See 'pending' status* after submit

*requests tab in dev tools

Expected file returns a 4xx error image

Expected Behavior

Expected unacceptable file request returns a 4xx error

Which browser are you using? (if relevant)

Edge Version 128.0.2739.54 (Official build) (64-bit) (also tested with chrome - same effect )

gparlakov commented 1 week ago

Notes:

sashko9807 commented 6 days ago

Unable to reproduce on my end. The server responds with 500(though we can improve the respond to be 4xx).