mime-types icon indicating copy to clipboard operation
mime-types copied to clipboard

Type inconsistencies between node-mime, MDN, and mime-db

Open broofa opened this issue 7 years ago • 2 comments

Related to https://github.com/broofa/node-mime/issues/162

The v2 unit test I have in node-uuid turned up some mappings that seem "questionable" in mime-types. I believe these are a result of the more nuanced approach to extension resolution I have in v2 that prefers "standard" types over vendor (or in the "x-" cases, experimental) types.

Again, this isn't breaking anything for me, but may be worth addressing.

AssertionError: Type inconsistencies: [
  "mime-types[exe] = application/x-msdos-program, node-uuid[exe] = application/octet-stream",
  "mime-types[dll] = application/x-msdownload, node-uuid[dll] = application/octet-stream",
  "mime-types[deb] = application/x-debian-package, node-uuid[deb] = application/octet-stream",
  "mime-types[dmg] = application/x-apple-diskimage, node-uuid[dmg] = application/octet-stream",
  "mime-types[iso] = application/x-iso9660-image, node-uuid[iso] = application/octet-stream",
  "mime-types[msi] = application/x-msdownload, node-uuid[msi] = application/octet-stream",
  "mime-types[wav] = audio/wave, node-uuid[wav] = audio/wav"

broofa avatar Jun 16 '17 23:06 broofa

It looks like all but one can at least be attributed to the resolution I implemented which has the rule of "any type is better than application/octet-stream". I'm wondering why application/octet-stream may be more preferable to other types.

The other is audio/wav vs audio/wave. Not sure what to make of that off-hand.

dougwilson avatar Jun 16 '17 23:06 dougwilson

If you look at the scores in https://github.com/broofa/node-mime/issues/162, it shows (once you know how to read them)... the octet-stream types are 1) on the "standard" facet (no x-* prefix), and 2) sourced from IANA. Whereas the x-* ones are 1) on the experimental facet, and 2) sourced form nginx. So.. octet-stream wins 2x.

audio/wav scores identically (both standard facet, both from apache)... wav only wins by virtue of being shorter. Which is rather arbitrary, but if you google around there doesn't appear to be any real consensus on this so... :-/

broofa avatar Jun 17 '17 00:06 broofa