Add MIME type for .mjs#12399
Merged
lukasmasuch merged 2 commits intostreamlit:developfrom Sep 2, 2025
Merged
Conversation
Contributor
🎉 Snyk checks have passed. No issues have been found so far.✅ security/snyk check is complete. No issues have been found. (View Details) ✅ license/snyk check is complete. No issues have been found. (View Details) |
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds MIME type support for .mjs (ES module) files by registering them with the application/javascript content type. This change is needed to properly serve .mjs files used by the st.pdf worker script on Windows platforms where the MIME type may not be correctly configured by default.
- Adds
.mjsextension mapping toapplication/javascriptMIME type in the server initialization - Extends existing test coverage to verify
.mjsfiles are handled correctly
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| lib/streamlit/web/server/server.py | Adds MIME type registration for .mjs files as application/javascript |
| lib/tests/streamlit/web/server/routes_test.py | Extends test setup and assertions to include .mjs file handling |
| lib/tests/streamlit/web/server/component_request_handler_test.py | Adds test cases for .mjs MIME type handling in component request handler |
lukasmasuch
approved these changes
Sep 2, 2025
Collaborator
lukasmasuch
left a comment
There was a problem hiding this comment.
LGTM 👍 Thanks for the contribution.
sfc-gh-lmasuch
approved these changes
Sep 2, 2025
This file contains hidden or 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
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.
Describe your changes
Added MIME type for
.mjsfile extension as it is needed for the worker script ofst.pdfon some Windows platformsGitHub Issue Link (if applicable)
Fixes #12387
Testing Plan
MIME types tests got extended.
Contribution License Agreement
By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.