Sorry, for some reasons I did not receive messages besides Wed, 29 Jan 2025 18:15:55 +0100, so I was unaware of comments.

On Sun, 26 Jan 2025 10:40:04 +0900 Charles Plessy wrote:
I was not aware that some tools use the order of extensions listed in
/etc/mime.types as an indication of priority.

It is unavoidable. Applications have to use some tie-break rule to
resolve ambiguity. Actually in python built-in mapping (having higher
priority) has been updated and my example reports proper media type
without modification of /etc/mime.types.

I am not sure that this
meaning is defined or conveyed in the media type declarations published
by the IANA…

And mime.types format is even more limited. It does not allow to convey
that both text/javascript and text/ecmascript both may have .mjs suffix,
but the former with "Intended usage: COMMON" while the latter "Intended
usage: OBSOLETE". Treating of entries order is left up to particular
application and almost certainly a part would pick first one and others
last entry.

I think that

text/javascript                                 js mjs es

is OK. A separate text/ecmascript entry might be even better, but I am
not sure.

--- mime.types.orig     2023-02-11 13:45:22.000000000 +0000
+++ mime.types  2025-02-01 11:44:56.420858567 +0000
@@ -2072,6 +2072,7 @@
 text/csv                                       csv
 text/csv-schema                                        csvs
 text/dns                                       soa zone
+text/ecmascript                                        es
 text/encaprtp
 text/enriched
 text/example
@@ -2082,7 +2083,7 @@
 text/grammar-ref-list
 text/hl7v2
 text/html                                      html htm shtml
-text/javascript                                        es js mjs
+text/javascript                                        js mjs
 text/jcr-cnd                                   cnd
 text/markdown                                  md markdown
 text/mizar                                     miz

Reply via email to