Skip to content

MediaTypeViewResult formatter does not support header values with quality parameter #35

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

Open
benfoster opened this issue Jul 13, 2014 · 0 comments

Comments

@benfoster
Copy link
Owner

A MediatypeViewResultFormatter with supported media type text/html should handle text/html;q=0.7.

Ideally we would parse the quality value but as a minimum should change the matching logic to use string.contains:

var supportedMediaType = SupportedMediaTypes.Any(
      mt => acceptTypes.Any(at => at.Contains(mt, StringComparison.OrdinalIgnoreCase)));

We also need to provide a default formatter or at least return a 415 (unsupported media type) if none of the formatters are matched.

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

1 participant