Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
broofa opened this issue Jun 16, 2017 · 2 comments
Open

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

broofa opened this issue Jun 16, 2017 · 2 comments

Comments

@broofa
Copy link
Member

broofa commented Jun 16, 2017

Related to broofa/mime#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"
@dougwilson
Copy link
Contributor

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.

@broofa
Copy link
Member Author

broofa commented Jun 17, 2017

If you look at the scores in broofa/mime#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... :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants