diff --git a/studio/backend/main.py b/studio/backend/main.py index 65f5e7fe90..67908d8617 100644 --- a/studio/backend/main.py +++ b/studio/backend/main.py @@ -23,10 +23,23 @@ if _backend_dir not in sys.path: # See: https://github.com/python/cpython/issues/102396 import _platform_compat # noqa: F401 +import mimetypes import shutil import warnings from contextlib import asynccontextmanager +# Fix broken Windows registry MIME types. Some Windows installs map .js to +# "text/plain" in the registry (HKCR\.js\Content Type). Python's mimetypes +# module reads from the registry, and FastAPI/Starlette's StaticFiles uses +# mimetypes.guess_type() to set Content-Type headers. Browsers enforce strict +# MIME checking for ES module scripts (