gh-97646: Change `.js` and `.mjs` files mimetype to conform to RFC 9239 (#97934)

This commit is contained in:
Noam Cohen 2022-10-07 22:00:53 +03:00 committed by GitHub
parent 3108fc1c16
commit 2a168355f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View 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',

View File

@ -0,0 +1 @@
Replace deprecated ``application/javascript`` with ``text/javascript`` in :mod:`mimetypes`. See :rfc:`9239`. Patch by Noam Cohen.