Skip to content

Conversation

@johnfraney
Copy link
Contributor

@johnfraney johnfraney commented Nov 3, 2025

Updates MIME types with .cjs type of application/node for CommonJS modules. See here for more information: https://www.iana.org/assignments/media-types/application/node

Fixes #140942

@johnfraney johnfraney requested a review from a team as a code owner November 3, 2025 08:51
@python-cla-bot
Copy link

python-cla-bot bot commented Nov 3, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

This comment was marked as resolved.

1 similar comment
@bedevere-app

This comment was marked as resolved.

@bedevere-app

This comment was marked as resolved.

@johnfraney johnfraney changed the title Add support for .cjs mimetype gh-140942: Add support for .cjs mimetype Nov 3, 2025
@bedevere-app bedevere-app bot mentioned this pull request Nov 3, 2025
Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this change is correct, it is not officially registered with IANA as required.

@johnfraney
Copy link
Contributor Author

I do not think this change is correct, it is not officially registered with IANA as required.

Thanks for the review, @StanFromIreland! I updated this PR to add the extension to common_types like you suggested

@johnfraney johnfraney changed the title gh-140942: Add support for .cjs mimetype gh-140942: Add mimetype to common_types for .cjs extension Nov 4, 2025
@hugovk
Copy link
Member

hugovk commented Nov 5, 2025

IANA says .cjs is an extension for the application/node type for CommonJS modules, not text/javascript:

https://www.iana.org/assignments/media-types/application/node

See here for more information: nodejs.org/api/modules.html#enabling

And this makes no mention of the MIME type.

@johnfraney johnfraney changed the title gh-140942: Add mimetype to common_types for .cjs extension gh-140942: Add mimetype for .cjs extension Nov 7, 2025
@hugovk
Copy link
Member

hugovk commented Nov 7, 2025

Thanks for the update. And because this is actually registered with IANA, we can put it in the regular list.

Please also don't force push in this repo, it makes it a bit harder to review changes. We squash merge anyway at the end.

@johnfraney
Copy link
Contributor Author

@hugovk That's a good point about force-pushing. Thank you for your help!

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add to the first in the mimetypes list at https://docs.python.org/3.15/whatsnew/3.15.html#mimetypes

johnfraney and others added 4 commits November 8, 2025 03:47
Adds .cjs mimetype of `text/javascript` for CommonJS modules to
common_types. See here for more information:
https://nodejs.org/api/modules.html#enabling
…e-140942.GYns6n.rst


Add changes to news entry from code review

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@johnfraney johnfraney changed the title gh-140942: Add mimetype for .cjs extension gh-140942: Add MIME type for .cjs extension Nov 10, 2025
@johnfraney johnfraney requested a review from hugovk November 10, 2025 04:30
@hugovk
Copy link
Member

hugovk commented Nov 11, 2025

Reminder about these things :)

Please add to the first in the mimetypes list at docs.python.org/3.15/whatsnew/3.15.html#mimetypes

Please also don't force push in this repo, it makes it a bit harder to review changes. We squash merge anyway at the end.

@johnfraney
Copy link
Contributor Author

@hugovk Oh, weird, I think my local repo had an issue because I checked out with a depth of 1 and git fetch wasn't working. I've got that sorted now and can push from my local branch normally. Thanks for your patience!

Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@hugovk hugovk enabled auto-merge (squash) November 11, 2025 14:28
@hugovk hugovk merged commit d890aba into python:main Nov 11, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add .cjs to mimetypes

3 participants