Skip to content

Commit 5f6fbcf

Browse files
authored
Fix mimetype for JS files (#532)
1 parent e8b1bf3 commit 5f6fbcf

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

mesop/server/static_file_serving.py

+7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import gzip
22
import io
3+
import mimetypes
34
import os
45
import re
56
import secrets
@@ -17,6 +18,12 @@
1718
WEB_COMPONENTS_PATH_SEGMENT = "__web-components-module__"
1819

1920

21+
# mimetypes are not always set correctly, thus manually
22+
# setting the mimetype here.
23+
# See: https://github.com/google/mesop/issues/441
24+
mimetypes.add_type("application/javascript", ".js")
25+
26+
2027
def noop():
2128
pass
2229

0 commit comments

Comments
 (0)