I have started working on the v2 version of the Mime library, used by Plug and Phoenix. The previous version depended on an external Mime database, which made it complicated for us to handle corner cases and, often times, it was too large.
The new version starts a new database from scratch, which should be faster to compile, faster to run, and use less memory. However, it may be missing important mime types. Therefore, I would like to request the community help in two possible ways:
Compare the list of supported extensions with the files you have in priv/static (or assets/static). Are all extensions listed? If not, please send a PR to add unsupported extensions.
Use mime master as a dependency in your project and see if anything fails:
I still think that using an external database is generally a good choice, even if it is something that is only manually updated and may generate a file that can be parsed during compile.
I maintain mime-types-data, and I’m happy to update the code there to generate something that is both smaller and easier to work with but more comprehensive than the ~76 types that I see now. (It’s pretty easy to filter the data so that only items with extensions are included (still probably larger than expected as there are 1,198 extensions known to the complete database and 824 extensions attached to 864 IANA registered types).
Currently, application/javascript prevails between the two, but can be overriden by including text/javascript in the config :mime, :types map. This is obviously not ideal. If text/javascript is indeed the way to go, application/javascript should perhaps be removed, or at least text/javascript should be the default MIME type used in response headers.
Got RSI, so spend so time off keyboard, hence the late reply.
Did not encounter any issues with importing it as a dep; didn’t find any files in priv/static not listed.
Found a small list in my code (which only checks for ‘zip’, image’ and ‘xml’) with a few Mime-types returned in content-type header. Those may not be ‘standard’ (hence my custom list) but maybe they are used more often. The mentioned RSI prevents me from investigating.
Yes, I did. Double checked ervery time. Running after each change: mix deps.clean mime --build
The MIME that is using the semicolon separated version does not work (I mean the plug :accepts, ["v1"] errors kicks in with a 406 response (which is the expected behavior for a not compatible type, right?)