-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-92626: Correct JavaScript MIME types + extensions per RFC 9239 #92627
Conversation
This patch updates the MIME type configuration per RFC 9239. https://www.rfc-editor.org/rfc/rfc9239 First, the recommended MIME type is now `text/javascript`: > The most widely supported media type in use is `text/javascript`; all > others are considered historical and obsolete aliases of `text/javascript`. Second, the `.mjs` extension is now explicitly registered: > The `.mjs` file extension signals that the file represents a JavaScript > module. Execution environments that rely on file extensions to > determine how to process inputs parse `.mjs` files using the Module > grammar of [ECMA-262]. IANA template: https://www.iana.org/assignments/media-types/text/javascript
Every change to Python requires a NEWS entry. Please, add it using the blurb_it Web app or the blurb command-line tool. |
🎉🎉🎉 Finally encoding-aware human-readable text is treated as such (
|
Lib/test/mime.types should maybe be updated, although it seems that file hasn't been substantively updated since 2011: Line 1217 in cb04a09
Also: Lines 213 to 217 in 1f134e9
A |
@warsaw would we backport something like this? I'm unsure if it would count as a bugfix. A |
It would be great to have this PR merged since it brings stuff to the latest RFC. |
This was changed in #97934. Apologies for forgetting this PR. |
This patch updates the MIME type configuration per RFC 9239.
https://www.rfc-editor.org/rfc/rfc9239
First, the recommended MIME type is now
text/javascript
:Second, the
.mjs
extension is now explicitly registered:cpython already had an entry for
.mjs
(great!), but it was using the obsoleteMIME type.
IANA template: https://www.iana.org/assignments/media-types/text/javascript
Issue: #92626