-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 [#4795] Invert validation for .msg files
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.
- Loading branch information
1 parent
32b30d4
commit 5cf6ed0
Showing
2 changed files
with
32 additions
and
22 deletions.
There are no files selected for viewing
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
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