type-is
type-is copied to clipboard
`is(req, 'xml')` should be true when content-type is `text/xml`
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.
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.