You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure that mimetypes is supposed to be 100% compliant with IANA. For example, we support the .jpe extension for JPEG files, despite that not being specified.
There are also several supported extensions for application/octet-stream, and IANA doesn't specify any file extension for that. That suggests IANA's file extension specification isn't meant to be exhaustive.
FTR, mimetypes is supposed to be IANA compliant, as per the comment:
# Before adding new types, make sure they are either registered with IANA,
# at https://www.iana.org/assignments/media-types/media-types.xhtml
# or extensions, i.e. using the x- prefix
That seems like a bug, the addition of .exe (1997) predates the official registration (2015) of the application/vnd.microsoft.portable-executable mimetype.
Activity
StanFromIreland commentedon Nov 3, 2025
I do not think this change is correct, it is not officially registered with IANA as required,
.cjsis not listed as an alias of text/javascript:ZeroIntensity commentedon Nov 3, 2025
I'm not sure that
mimetypesis supposed to be 100% compliant with IANA. For example, we support the.jpeextension for JPEG files, despite that not being specified.There are also several supported extensions for
application/octet-stream, and IANA doesn't specify any file extension for that. That suggests IANA's file extension specification isn't meant to be exhaustive.StanFromIreland commentedon Nov 3, 2025
The two cases you mentioned exist in
mimetypessince 1997 (ac8a9f3), only in 2006 was the comment requiring they be registered added.StanFromIreland commentedon Nov 3, 2025
We can put it in
common_types, which allows for non-IANA registered types. Per the documentation:picnixz commentedon Nov 3, 2025
FTR,
mimetypesis supposed to be IANA compliant, as per the comment:The reason why
.exe& co are mapped to octect-stream is likely for convenience (the IANA type for.exeis https://www.iana.org/assignments/media-types/application/vnd.microsoft.portable-executable) and usingoctect-streaminstead to indicate binary data is probably the best practical choice.johnfraney commentedon Nov 4, 2025
Oh! Thank you, @StanFromIreland. I missed that comment. I'll put up a PR with that extension added to
common_typesinsteadStanFromIreland commentedon Nov 4, 2025
That seems like a bug, the addition of
.exe(1997) predates the official registration (2015) of theapplication/vnd.microsoft.portable-executablemimetype.gh-140942: Add MIME type for .cjs extension (#140937)
pythongh-140942: Add MIME type for .cjs extension (python#140937)