jshttp / mime-db

Media Type Database
MIT License
1.09k stars 256 forks source link

ts extension incorrectly mapped to video/mp2t ? #284

Closed ericvergnaud closed 1 year ago

ericvergnaud commented 1 year ago

Hi, with the advent of typescript, the ts extension mapping to video/mp2t may no longer be correct. This is creating blocking issues in software using mime-db, such as webpack-dev-middleware, which provides an incorrect Content-Type when serving a typescript file. Not sure what's the philosophy here, happy to submit a PR, if it can be considered

dougwilson commented 1 year ago

Hi @ericvergnaud thank you for your issue. This database pulls from the three sources listed at the top; if there is an issue there, you may need to address it at the source itself. As for this database, though, it would seem that .ts is indeed a valid file extension for video/mp2t, as that is what is contained on DVD and other discs that are still out in the wild and used regularly. I'm not sure what solution you are looking for, but as long as it is registered with IANA we'll continue to include it in our database. Trying to say one person's mime/extension is more important than another person's is outside the scope of this module.

dougwilson commented 1 year ago

It seems there is not even a MIME type for TypeScript at all, which is probably the main issue. We have linked to the process to register MIME types with the IANA in our readme: https://github.com/jshttp/mime-db#registering-media-types

ericvergnaud commented 1 year ago

Thanks, that answers my question

dougwilson commented 1 year ago

No problem! And of course this database is just a object with all the mime types and then it has a list of extensions. If TypeScript is registered in the IANA, for example, then it'll be included here no problem just like any other type. This database is just a mapping of mime types to information about them, so they can co-exist here 👍