-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Correct JavaScript MIME types + extensions per RFC 9239 #318
Correct JavaScript MIME types + extensions per RFC 9239 #318
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 Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=61383
Related PRs: |
Thanks for you PR. I see no problem with adding We can take in that change into our What are your expectations? |
Browsers continue to support all JavaScript MIME types equally: https://mimesniff.spec.whatwg.org/#javascript-mime-type It's just that
The new RFC finally makes this reality official at the IETF level as well. So it's exactly like you said: the switch from I don't have any strong opinions on which version this patch should make it into. I would understand if you'd rather wait for a minor release (v2.5.0?). I trust the Apache team to make that decision. My main concern is simply the timing: waiting "too long" to land this could cause more deployments to diverge from what is now a cross-standard MIME type agreement. |
It's good to define that clearly going forward, I agree.
I envy your optimism. In my experience, I would expect several enterprise proxies to break on such a mime type change.
Ok, added to trunk in r1901273. |
Thank you! f4230a5 Should we close this PR now? |
Indeed. Thanks for making the PR! |
FWIW, not all user agents are browsers. |
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:IANA template: https://www.iana.org/assignments/media-types/text/javascript
Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=61383