jshttp / mime-db

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

YAML missing some types #294

Closed 6XGate closed 1 year ago

6XGate commented 1 year ago

As published by the IETF in HTTP API, some deprecated types for YAML are application/x-yaml, text/yaml, text/x-yaml. While this is from a draft spec, several software suites (server, desktop, etc.) use the others. YAML though appears to have never been official registered, at least not with IANA's MIME DB. While keeping text/yaml the default for the yaml type, the other should likely point back to the .yaml extension and have a UTF-8 canonical character type associated with them.

dougwilson commented 1 year ago

Hello, and thank you for your issue. This module does not include deprecated (or as IANA generally calls "obsolete") types, as such they are omitted on purpose. I can add a note to the readme for clarity on this 👍

6XGate commented 1 year ago

Any idea what package might handle all legacy types?

dougwilson commented 1 year ago

It looks like the existing entry is from the original merge of data from the mime lib so has no source. Probably needs to be changed to application/yaml.

I see the YAML project itself doesn't even seem to have a grasp on what their media type is, however 🤔 https://github.com/yaml/yaml-spec/issues/49

Any idea what package might handle all legacy types?

No, sadly I am not familiar with any other libs since I made this to serve my needs 👍

6XGate commented 1 year ago

Yes, and to complicate matters. The GNOME MIME database uses application/x-yaml. Thought it seems that is the time of DB I'm looking for since what I want to know is the related type to the MIME type of a file determined by AWS S3 and MinIO.

dougwilson commented 1 year ago

Gotcha. Yea, I just made this to list out the type data from the three sources at the top of the readme: IANA, Apache, and NGINX. I imported initial defs from an old Node.js project I was using before and this was one of them. Maybe just removing yaml is better and let someone add to IANA at some point.