type-is icon indicating copy to clipboard operation
type-is copied to clipboard

`is(req, 'xml')` should be true when content-type is `text/xml`

Open creeperyang opened this issue 9 years ago • 1 comments

When I use koa and its this.is('xml'), it makes me confused:

// content-type: 'text/xml'
this.is('xml') // false

I think application/xml and text/xml are both valid xml type.

creeperyang avatar Jan 05 '16 06:01 creeperyang

Hi @creeperyang, yes, I agree. The weird discrepancy comes from how everything got bundled together: when you specify a file extension, instead of doing what seems more logical, and what you wait, and check for every possible media type that could represent that file extension, it instead only matches the primary media type for that extension.

The issue #15 is pretty much exactly the same issue, just for a different type.

dougwilson avatar Feb 29 '16 04:02 dougwilson