Skip to content

Commit d0c4d6a

Browse files
committed
use static mime types
1 parent 7303c27 commit d0c4d6a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/py/reactpy/reactpy/backend/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
# Fix for issue where Windows registry gets corrupt and mime types go missing
44
mimetypes.init()
5-
for extension, mime_type in mimetypes.common_types.items():
5+
MIME_TYPES = {
6+
".js": "application/javascript",
7+
".css": "text/css",
8+
".ico": "image/x-icon",
9+
".png": "image/png",
10+
".jpg": "image/jpeg",
11+
".jpeg": "image/jpeg",
12+
".svg": "image/svg+xml",
13+
".json": "application/json",
14+
}
15+
for extension, mime_type in MIME_TYPES.items():
616
if not mimetypes.types_map.get(extension):
717
mimetypes.add_type(mime_type, extension)

0 commit comments

Comments
 (0)