Skip to content

Commit faba96e

Browse files
committed
gh-97646: change .js and .mjs files mimetype to conform to RFC 9239
1 parent 2016bc5 commit faba96e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Lib/mimetypes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -427,8 +427,8 @@ def _default_mime_types():
427427
# Make sure the entry with the preferred file extension for a particular mime type
428428
# appears before any others of the same mimetype.
429429
types_map = _types_map_default = {
430-
'.js' : 'application/javascript',
431-
'.mjs' : 'application/javascript',
430+
'.js' : 'text/javascript',
431+
'.mjs' : 'text/javascript',
432432
'.json' : 'application/json',
433433
'.webmanifest': 'application/manifest+json',
434434
'.doc' : 'application/msword',
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Replace deprecated ``application/javascript`` with ``text/javascript`` in :mod:`mimetypes`. See :rfc:`9239`. Patch by Noam Cohen.

0 commit comments

Comments
 (0)