Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-allow handling empty request body [SPR-12778] #17376

Closed
spring-projects-issues opened this issue Mar 3, 2015 · 3 comments
Closed

Re-allow handling empty request body [SPR-12778] #17376

spring-projects-issues opened this issue Mar 3, 2015 · 3 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Mar 3, 2015

Oliver Drotbohm opened SPR-12778 and commented

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.


Affects: 4.1.5

Issue Links:

0 votes, 5 watchers

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Mar 3, 2015

Juergen Hoeller commented

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.

@spring-projects-issues
Copy link
Collaborator Author

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
Copy link
Collaborator Author

Rossen Stoyanchev commented

Commits 0556ed and 36ed4d introduce RequestBodyAdvice and provide it full control over the handling of an empty request body.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants