Skip to content

Rfc7231ProblemDetailsWriter.CanWrite Logic Is Inverted #1015

Closed
@kramnos

Description

@kramnos

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