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

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

Open
creeperyang opened this issue Jan 5, 2016 · 1 comment
Open

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

creeperyang opened this issue Jan 5, 2016 · 1 comment
Assignees

Comments

@creeperyang
Copy link

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 creeperyang changed the title is('xml') should be true when content-type is text/xml is(req, 'xml') should be true when content-type is text/xml Jan 5, 2016
@dougwilson dougwilson self-assigned this Feb 29, 2016
@dougwilson
Copy link
Contributor

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.

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

No branches or pull requests

2 participants