Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Mar 3, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Mar 17, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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

  3. spring-projects-issues commented on Mar 29, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

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

  4. added
    type: enhancement
    in: web
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions