浏览代码

Add correct mimetype for .mjs files

huchenlei 1 年之前
父节点
当前提交
3d3fc81f48
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      modules/ui.py

+ 1 - 0
modules/ui.py

@@ -38,6 +38,7 @@ warnings.filterwarnings("default" if opts.show_gradio_deprecation_warnings else
 # this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the browser will not show any UI
 mimetypes.init()
 mimetypes.add_type('application/javascript', '.js')
+mimetypes.add_type('application/javascript', '.mjs')
 
 # Likewise, add explicit content-type header for certain missing image types
 mimetypes.add_type('image/webp', '.webp')