-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
Affects: 5.1.6
Since the Upgrade from Spring-Boot-2.1.3.RELEASE to Spring-Boot-2.1.4.RELEASE, any error (e.g. a 404 or an 500) an expected 404 without an ACCEPT request header result in a 406 response and this message in the logs:
DefaultHandlerExceptionResolver : Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
This regression happens only when setting the default content type to TEXT_HTML:
@Configuration
class DefaultContentTypeConfiguration implements WebMvcConfigurer {
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.defaultContentType(TEXT_HTML);
}
}
See spring-attic/spring-framework-issues#191 for an example.
On a site note: This is the second bug in a very short time (the other was #22851) which goes unnoticed with Spring's classic MockMVC
testing approach. It makes me thing that using MockMVC
is not a too good idea any more.
Metadata
Metadata
Assignees
Labels
in: webIssues in web modules (web, webmvc, webflux, websocket)Issues in web modules (web, webmvc, webflux, websocket)type: regressionA bug that is also a regressionA bug that is also a regression