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
{{ message }}
Repository navigation
Re-allow handling empty request body [SPR-12778] #17376
In case a request contains an empty body, Spring 4.1's RequestResponseBodyMethodProcessor calls handleEmptyBody(…) and immediately returns null without further consideration of HandlerMethodArgumentResolver instances that might be able to deal with an empty request body.
This is a regression in cases where the HandlerMethodArgumentResolver was explicitly designed to return a default value, which worked fine with 4.0.x.
On a related note, #16766 suggested a softer landing for null return values, letting them go through ResponseBodyAdvice for the purpose of turning it into a default value. That use case seems similar to the present one, since this issue is essentially about passing a null request body to converters for the purpose of returning a default value.
Since this more or less worked accidentally before, we're trying to provide a proper solution for the problem in 4.2, not messing with the behavior in the 4.1.x line anymore (since any change might be a regression for somebody).
Activity
spring-projects-issues commentedon Mar 3, 2015
Juergen Hoeller commented
On a related note, #16766 suggested a softer landing for
nullreturn values, letting them go throughResponseBodyAdvicefor the purpose of turning it into a default value. That use case seems similar to the present one, since this issue is essentially about passing anullrequest body to converters for the purpose of returning a default value.spring-projects-issues commentedon Mar 17, 2015
Juergen Hoeller commented
Since this more or less worked accidentally before, we're trying to provide a proper solution for the problem in 4.2, not messing with the behavior in the 4.1.x line anymore (since any change might be a regression for somebody).
Juergen
spring-projects-issues commentedon Mar 29, 2015
Rossen Stoyanchev commented
Commits 0556ed and 36ed4d introduce RequestBodyAdvice and provide it full control over the handling of an empty request body.