Skip to content

python(fix): fall back to application/octet-stream for unknown MIME t…#509

Merged
wei-qlu merged 4 commits intomainfrom
python/update-file-uploads-for-arbitrary-types
Mar 24, 2026
Merged

python(fix): fall back to application/octet-stream for unknown MIME t…#509
wei-qlu merged 4 commits intomainfrom
python/update-file-uploads-for-arbitrary-types

Conversation

@wei-qlu
Copy link
Copy Markdown
Contributor

@wei-qlu wei-qlu commented Mar 24, 2026

What was changed:

Instead of raising an error when a file upload didn't have a supported MIME type in mimetypes (built-in python library), we will fallback to a generic binary data MIME type: application/x-{extension}. The backend simply stores the files to S3 and serves them back for download (presigned S3 url) with no special processing based on MIME/content type (remote_file_service.go).

Verification

Unit tests to verify the upload_attachment function will return a mime type of application/x-{extension} for file types that are not currently supported in mimetypes.

Tested file attachment uploads on a local script with file types not supported by mimetypes and verified the data was intact.

@wei-qlu wei-qlu marked this pull request as ready for review March 24, 2026 21:14
@wei-qlu wei-qlu merged commit 29ac6f6 into main Mar 24, 2026
21 checks passed
@wei-qlu wei-qlu deleted the python/update-file-uploads-for-arbitrary-types branch March 24, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants