You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following line causing 406 Error while using any subtype of ProblemDetail class.
// For ProblemDetail, fall back on RFC 7807 format
if (bestMediaType == null && elementType.toClass().equals(ProblemDetail.class)) {
bestMediaType = selectMediaType(exchange, () -> getMediaTypesFor(elementType), this.problemMediaTypes);
}
The issue does not exists in Servlet as it checks the error body type is assignable of ProblemDetail class.
// For ProblemDetail, fall back on RFC 7807 format
if (compatibleMediaTypes.isEmpty() && ProblemDetail.class.isAssignableFrom(valueType)) {
determineCompatibleMediaTypes(this.problemMediaTypes, producibleTypes, compatibleMediaTypes);
}
rstoyanchev
changed the title
Webflux - Exception Handler - ProblemDetail subtype usage causing 406 error
WebFlux returns 406 instead of an RFC 7807 for subtype of ProblemDetail WebFlux
May 30, 2023
rstoyanchev
changed the title
WebFlux returns 406 instead of an RFC 7807 for subtype of ProblemDetail WebFlux
WebFlux returns 406 instead of RFC 7807 response for subtype of ProblemDetail
May 30, 2023
The following line causing 406 Error while using any subtype of ProblemDetail class.
(https://github.com/spring-projects/spring-framework/blob/main/spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/AbstractMessageWriterResultHandler.java#L178)
The issue does not exists in Servlet as it checks the error body type is assignable of ProblemDetail class.
https://github.com/spring-projects/spring-framework/blob/main/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/AbstractMessageConverterMethodProcessor.java#L247
The text was updated successfully, but these errors were encountered: