Skip to content

Clarify whether HttpInputMessage.getBody() is allowed to return null [SPR-13563] #18139

Closed
@spring-projects-issues

Description

@spring-projects-issues

Juergen Hoeller opened SPR-13563 and commented

Initiated by #886, we should clarify whether HttpInputMessage.getBody() is allowed to return null, in particular for ClientHttpResponse implementations. BufferingClientHttpResponseWrapper should then defensively check for a null body before trying to buffer it into a byte array, or we should enforce non-null body values where they can currently be null: specifically, in HttpComponents(Async)ClientHttpResponse which seems to be the only implementation that currently returns null for an empty body to begin with.


Affects: 3.2.14, 4.1.7, 4.2.1

Referenced from: commits a5f81a0, ca60d79, 8a82259, 66177df

Backported to: 4.1.8, 3.2.15

Metadata

Metadata

Assignees

Labels

status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions