FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-140942: Add MIME type for .cjs extension by johnfraney · Pull Request #140937 · python/cpython · GitHub

Repository navigation

gh-140942: Add MIME type for .cjs extension - #140937

Merged
hugovk merged 5 commits into
python:mainfrom
johnfraney:patch-1
Nov 11, 2025
Merged

hugovk merged 5 commits into
python:mainfrom
johnfraney:patch-1

Conversation

johnfraney commented Nov 3, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

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 requested a review from a team as a code owner November 3, 2025 08:51

python-cla-bot Bot commented Nov 3, 2025 •
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

This comment was marked as resolved.

1 similar comment

This comment was marked as resolved.

This comment was marked as resolved.

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

StanFromIreland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Comment thread Lib/mimetypes.py

Copy link
Copy Markdown
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 changed the title gh-140942: Add support for .cjs mimetype gh-140942: Add mimetype to common_types for .cjs extension Nov 4, 2025

hugovk commented Nov 5, 2025

Copy link
Copy Markdown
Member

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 changed the title gh-140942: Add mimetype to common_types for .cjs extension gh-140942: Add mimetype for .cjs extension Nov 7, 2025

hugovk commented Nov 7, 2025

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 changed the title gh-140942: Add mimetype for .cjs extension gh-140942: Add MIME type for .cjs extension Nov 10, 2025
johnfraney requested a review from hugovk November 10, 2025 04:30

hugovk commented Nov 11, 2025

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
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!

hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thank you!

hugovk enabled auto-merge (squash) November 11, 2025 14:28
hugovk merged commit d890aba into python:main Nov 11, 2025
50 checks passed
StanFromIreland pushed a commit to StanFromIreland/cpython that referenced this pull request Dec 6, 2025
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL