-
Notifications
You must be signed in to change notification settings - Fork 26
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
.msg file upload #4961
.msg file upload #4961
Conversation
The removal of the |
6833a2c
to
4908172
Compare
The |
4908172
to
2d11d04
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4961 +/- ##
=======================================
Coverage 96.64% 96.64%
=======================================
Files 761 761
Lines 25904 25908 +4
Branches 3385 3386 +1
=======================================
+ Hits 25036 25040 +4
Misses 604 604
Partials 264 264 ☔ View full report in Codecov by Sentry. |
cc51188
to
5e77364
Compare
5e77364
to
061dce1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please exclude backend translations from PRs? They get sorted out during the release preparation.
They're a frequent source of merge conflicts otherwise.
061dce1
to
647522e
Compare
071c30b
to
d82f035
Compare
The SDK cannot reliably determine which content type belongs to a .msg file, most notably on Linux and MacOS because the extension is not in the mime type database. This manifests as a file being uploaded with empty content-type. To allow these files to go through, the serializer must allow empty values for the 'type' field which contains the detected content type, and the backend must perform additional processing to determine the file type. We can do this by falling back to the generic case of 'binary file' (application/octet-stream) content type, and let libmagic figure out which extensions belong to the magic bytes, i.e. we look at the magic bytes to figure out what kind of file was provided, and we check the provided file extensions against the list of valid extensions for the detected file type.
The validator now rejects (temporary) file uploads that don't have an extension, as this prevents validating that the extension and content type match. This used to pass and would then be caught later when linking the file upload component and temporary file upload.
1ac9576
to
f3bf841
Compare
The SDK cannot reliably determine which content type belongs to a .msg file, most notably on Linux and MacOS because the extension is not in the mime type database. This manifests as a file being uploaded with empty content-type. To allow these files to go through, the serializer must allow empty values for the 'type' field which contains the detected content type, and the backend must perform additional processing to determine the file type. We can do this by falling back to the generic case of 'binary file' (application/octet-stream) content type, and let libmagic figure out which extensions belong to the magic bytes, i.e. we look at the magic bytes to figure out what kind of file was provided, and we check the provided file extensions against the list of valid extensions for the detected file type. Backport-of: #4961
The SDK cannot reliably determine which content type belongs to a .msg file, most notably on Linux and MacOS because the extension is not in the mime type database. This manifests as a file being uploaded with empty content-type. To allow these files to go through, the serializer must allow empty values for the 'type' field which contains the detected content type, and the backend must perform additional processing to determine the file type. We can do this by falling back to the generic case of 'binary file' (application/octet-stream) content type, and let libmagic figure out which extensions belong to the magic bytes, i.e. we look at the magic bytes to figure out what kind of file was provided, and we check the provided file extensions against the list of valid extensions for the detected file type. Backport-of: #4961
Closes #4795
Changes
The sdk cannot determine what content type should be used for .msg files, which results in the content type
""
. When you try to submit the form, the fileSerializer doesn't recognizes the content type and returns an error.To allow the submission of .msg files, the content type should be allowed to be empty.
type
property onFileSerializer
optionalMimeTypeValidator
Checklist
Check off the items that are completed or not relevant.
Impact on features
Release management
I have updated the translations assets (you do NOT need to provide translations)
./bin/makemessages_js.sh
./bin/compilemessages_js.sh
Dockerfile/scripts
./bin
folderCommit hygiene