-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve MIME type handling on File Upload and in Message Component #688
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74d701f
to
1b3caa1
Compare
1b3caa1
to
ce1a808
Compare
You can test this by uploading an .mkv file which has MIME type |
ajbura
approved these changes
Aug 14, 2022
ginnyTheCat
pushed a commit
to ginnyTheCat/cinny
that referenced
this pull request
Aug 14, 2022
…innyapp#688) * move allowed MIME types to own util file * add check for safe MIME type before choosing how to upload * check for allowed blob type to decide what component to load * re-add check for safe mimetype * fix bracket positioning
NovaAndrom3da
pushed a commit
to NovaAndrom3da/neocinny
that referenced
this pull request
Nov 23, 2023
…innyapp#688) * move allowed MIME types to own util file * add check for safe MIME type before choosing how to upload * check for allowed blob type to decide what component to load * re-add check for safe mimetype * fix bracket positioning
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Currently if you upload a file with MIME type prefixes
video/
,audio/
orimage/
that is not in theALLOWED_BLOB_MIMETYPES
the file type will be converted toapplication/octet-stream
bygetBlobSafeMimeType
. However, the React element used to display the file in the timeline is still a video, audio or image element. This appears to cancel the file upload and the file attachment shelf gets stuck on the screen.Changes:
m.file
Type of change
Checklist:
Preview: https://62f67680a954bc0932c98961--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️