Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
Breaking change in MVC: Accept handling is now more strict [SPR-16251] #20798
This was seemingly OK with 5.0.1 and before. After upgrading to 5.0.2, it forces to return 406, despite the ResponseEntity saying otherwise.
The commit that caused it is:
The RFC says:
Please note that it says SHOULD, and not MUST:
So, a patch release of Spring seems to be enforcing a more strict behaviour, disallowing something allowed (albeit not recommended) by RFC, and breaking existing applications.
A workaround is possible by having a nasty servlet filter that manipulates headers, and adds application/*+json when application/json is in Accept... but, considering this is a patch release, I suggest you consider this behaviour change a bug, as it has backward-compatibility implications, and try not to break acceptable flows.
Referenced from: commits fda0885
Rossen Stoyanchev commented
This should be resolved now. I've made a change to use the media type from the