From faba96ec59d095171b87716a1cfe9da84a4d1465 Mon Sep 17 00:00:00 2001 From: Noam Cohen Date: Wed, 5 Oct 2022 23:46:05 +0300 Subject: [PATCH] gh-97646: change `.js` and `.mjs` files mimetype to conform to RFC 9239 --- Lib/mimetypes.py | 4 ++-- .../Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst 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/Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst b/Misc/NEWS.d/next/Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst new file mode 100644 index 00000000000000..6eed16c8e8bbfb --- /dev/null +++ b/Misc/NEWS.d/next/Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst @@ -0,0 +1 @@ +Replace deprecated ``application/javascript`` with ``text/javascript`` in :mod:`mimetypes`. See :rfc:`9239`. Patch by Noam Cohen.