Skip to content

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

@benfoster

Description

@benfoster

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions