diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py index f6c43b3b92bc50..3224363a3f2bfb 100644 --- a/Lib/mimetypes.py +++ b/Lib/mimetypes.py @@ -427,8 +427,8 @@ def _default_mime_types(): # Make sure the entry with the preferred file extension for a particular mime type # appears before any others of the same mimetype. types_map = _types_map_default = { - '.js' : 'application/javascript', - '.mjs' : 'application/javascript', + '.js' : 'text/javascript', + '.mjs' : 'text/javascript', '.json' : 'application/json', '.webmanifest': 'application/manifest+json', '.doc' : 'application/msword', diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-05-10-14-52-29.gh-issue-92626._qhwB8.rst b/Misc/NEWS.d/next/Core and Builtins/2022-05-10-14-52-29.gh-issue-92626._qhwB8.rst new file mode 100644 index 00000000000000..4979c9e6a767ae --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-05-10-14-52-29.gh-issue-92626._qhwB8.rst @@ -0,0 +1 @@ +Correct JavaScript MIME types + extensions per RFC 9239