Skip to content

Commit 42d209e

Browse files
authored
Fix incorrect MIME type being inferred on Win during serving
For explanation, see https://stackoverflow.com/questions/59355194
1 parent 6976249 commit 42d209e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: server.py

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@
1515
from backend.prompts import list_prompt_formats
1616
from backend.settings import get_settings, set_settings
1717

18+
19+
if os.name == "nt":
20+
# Fix Windows inferring text/plain MIME type for static files
21+
# https://stackoverflow.com/questions/59355194/
22+
import mimetypes
23+
mimetypes.add_type("application/javascript", ".js")
24+
mimetypes.add_type("text/css", ".css")
25+
1826
app = Flask("ExUI")
1927
app.static_folder = 'static'
2028
api_lock = Lock()

0 commit comments

Comments
 (0)