Add mime-support as upstream source for MIME types.
Adds mime-support mime.types file as 4th non custom upstream source.
File structure is identical to Apache as the upstream file is a drop in replacement for the Apache mime.types files (actually it's the other way around ..).
In this PR I've added a basic script to print out how many MIME from each source. I've also labelled custom types explicitly to help with tracing source in db.json:
Before:
total 2193
iana 1861
apache 250
nginx 13
mime-support 0
custom 0
undefined 0
other 69
After:
total 2381
iana 1861
apache 250
nginx 13
mime-support 192
custom 65
undefined 0
other 0
- Copy right info: https://salsa.debian.org/debian/mime-support/-/blob/master/debian/copyright
- DB Lineage: A major upstream source of these MIME types is Freedesktop.org's shared-mime-info. Beyond that it's unclear exactly but you can see the commit history here. I feel it is much the same as Apache and Nginx: The maintainers just add entries as they see fit when it's reasonable. Also note, it is this file that is the default mime.types file, and the file that will be used by Apache server (or probably any other kind of HTTP server) running on a Debian based distro, given Apache is installed from pkg manager.
@sgpinkus I'm looking into what is coming in because there are several known places that use this module to provide file extension -> mime type mappings: The Node.js package https://www.npmjs.com/package/mime and GitHub Pages https://docs.github.com/en/enterprise/2.13/user/articles/mime-types-on-github-pages are two very notable ones. So we have to be very careful pulling in conflicting entries and understand how they are going to affect the behavior of these projects if there are conflicting mappings pulled in.
@sgpinkus I'm looking into what is coming in because there are several known places that use this module to provide file extension -> mime type mappings ...
OK. Understood. Still waiting on more info from maintainer. Will get back to you with any new info. If you can't merge that is totally fine.
@dougwilson I got a reply from the maintainer of mime-support, Charles Plessy. It seems many of the MIME types in mime-support DB were added over the years by hand. He indicated that pulling directly from IANA would have been preferable now that IANA has become more receptive to adding new MIME types.
I pointed out that you have a script that pulls from IANA already. And directed him to this repository, and also this PR.
Still it would be useful to get some of the types in mime-support added here. I guess, in retrospect, the proper process for doing this is actually, 1. IANA, 2. pre IANA the adhoc "custom" type registration process you have set up here.
For reference, here are the 192 MIME types in mime-support not in mime-db, in CSV, and JSON. Script to used generate is included.
https://github.com/younggun23/mime-db/Add mime-support as upstream source for MIME types