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

Multiple Mime-Types for an extension

Open jstans opened this issue 9 years ago • 4 comments

This relates to: koajs/koa#617.

As an extension can correspond to multiple mime-types, wouldn't it be correct to return an array of all matches and let libraries handle that?

Perhaps a .lookupAll() which strictly returns an array to avoid breaking existing code or over-complicating something which not everyone will want to make use of.

jstans avatar Dec 04 '15 10:12 jstans

@dougwilson Anyone working on this?

thihara avatar Oct 15 '16 03:10 thihara

HI @thihara nope. I see you made a PR, so awesome!

dougwilson avatar Oct 15 '16 03:10 dougwilson

This still has value, I just ran into it now. I see the pr for allExtensions but not for lookupAll (all mime types from a single extension) Makes it kind of difficult to check that the binary is what you are expecting from the extension or content-type headers.

I'm going to log an issue on our tracking system, if it doesn't move the odds are I will do it.

rijnhard avatar Apr 25 '17 16:04 rijnhard

I took a crack at this today and have a PR open for it. Hoping it's a good starting point to discuss more!

pseudoramble avatar May 06 '17 17:05 pseudoramble