Repository navigation
[FIX] add image format validation - #25912
Conversation
guijun13
left a comment
There was a problem hiding this comment.
As window.Buffer is not a web API, it`s not recommended to create a polyfill. If you are intend to use the window.buffer for the filetype, take a look at https://www.npmjs.com/package/file-type#browser , as using fileTypeFromStream, FileTypeFromBuffer or FileTypeFromBlob.
There was a problem hiding this comment.
I still thinks this is something that the sever should handle @tassoevan wdyt?
I believe this is work for both sides because the browser will try to render this image and we will get an error, for now, we don't handle this kind of error and the user doesn't have proper feedback on what is happening. And make a request to server just to validate the format and return feedback to the client will be more expensive than handling it on the front. |
A task was created to add validation on backend
|
This PR currently has a merge conflict. Please resolve this and then re-add the |
Codecov Report
@@ Coverage Diff @@
## develop #25912 +/- ##
===========================================
+ Coverage 38.54% 38.66% +0.12%
===========================================
Files 758 759 +1
Lines 18827 18809 -18
Branches 1453 1453
===========================================
+ Hits 7256 7273 +17
+ Misses 11355 11318 -37
- Partials 216 218 +2
Flags with carried forward coverage won't be shown. Click here to find out more. |
Co-authored-by: gabriellsh <40830821+gabriellsh@users.noreply.github.com>
Proposed changes (including videos or screenshots)
Issue(s)
Steps to test or reproduce
Further comments
Add validation to prevent the 'heic' format to be uploaded on the room and user's avatar.
This format is not supported on the browsers and meteor.
Before:


After:

