Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rfc7231ProblemDetailsWriter.CanWrite Logic Is Inverted #1015

Copy link
Copy link
Closed
@kramnos

Description

@kramnos
Issue body actions

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

As diagnosed here, it has been determined that the conditional logic inside the CanWrite method of Rfc7231ProblemDetailsWriter should be as follows:

if (acceptHeaderValue.IsSubsetOf(jsonMediaType) ||
    acceptHeaderValue.IsSubsetOf(problemDetailsJsonMediaType))
{
    return true;
}

This should allow problem details responses to be correctly emitted in the case where the incoming media type is more specific than the known media types, as is the case when an API version is included in the header, e.g. application/json; v=1.0.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.