Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@geoextra
Copy link
Contributor

@geoextra geoextra commented Sep 2, 2025

Describe your changes

Added MIME type for .mjs file extension as it is needed for the worker script of st.pdf on some Windows platforms

GitHub 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.

@snyk-io
Copy link
Contributor

snyk-io bot commented Sep 2, 2025

🎉 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)

@geoextra geoextra marked this pull request as ready for review September 2, 2025 08:45
@geoextra geoextra requested a review from a team as a code owner September 2, 2025 08:45
@lukasmasuch lukasmasuch requested a review from Copilot September 2, 2025 09:51
@lukasmasuch lukasmasuch added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Sep 2, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 .mjs extension mapping to application/javascript MIME type in the server initialization
  • Extends existing test coverage to verify .mjs files 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

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Thanks for the contribution.

@lukasmasuch lukasmasuch merged commit 7f2d03a into streamlit:develop Sep 2, 2025
37 of 38 checks passed
@geoextra geoextra deleted the fix/mjs-mime-type branch September 2, 2025 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect MIME types for st.pdf script on Windows

3 participants