]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-97646: Change `.js` and `.mjs` files mimetype to conform to RFC 9239 (#97934)
authorNoam Cohen <noam@noam.me>
Fri, 7 Oct 2022 19:00:53 +0000 (22:00 +0300)
committerGitHub <noreply@github.com>
Fri, 7 Oct 2022 19:00:53 +0000 (12:00 -0700)
Lib/mimetypes.py
Misc/NEWS.d/next/Library/2022-10-05-20-52-17.gh-issue-97646.Q4fVww.rst [new file with mode: 0644]

index f6c43b3b92bc5023ceec54fad8542c126e55cb1c..3224363a3f2bfb7617284ce140dd253a00cddef1 100644 (file)
@@ -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 (file)
index 0000000..6eed16c
--- /dev/null
@@ -0,0 +1 @@
+Replace deprecated ``application/javascript`` with ``text/javascript`` in :mod:`mimetypes`. See :rfc:`9239`. Patch by Noam Cohen.