Pass correct MIME type in emrun.py when serving .mjs files. (#28404) Yes apparently the correct type is `text/javascript` and not `application/javascript`: https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type , though emrun was not passing any MIME type at all.
diff --git a/emrun.py b/emrun.py index f19821c..8806d93 100644 --- a/emrun.py +++ b/emrun.py
@@ -847,6 +847,8 @@ ctype = 'application/wasm' if guess_file_type.lower().endswith('.js'): ctype = 'application/javascript' + elif guess_file_type.lower().endswith('.mjs'): + ctype = 'text/javascript' self.send_header('Content-type', ctype) fs = os.fstat(f.fileno()) self.send_header("Content-Length", str(fs.st_size))