Clarify whether HttpInputMessage.getBody() is allowed to return null [SPR-13563] #18139
Labels
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Juergen Hoeller opened SPR-13563 and commented
Initiated by #886, we should clarify whether
HttpInputMessage.getBody()
is allowed to returnnull
, in particular forClientHttpResponse
implementations.BufferingClientHttpResponseWrapper
should then defensively check for anull
body before trying to buffer it into a byte array, or we should enforce non-null
body values where they can currently benull
: specifically, inHttpComponents(Async)ClientHttpResponse
which seems to be the only implementation that currently returnsnull
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
The text was updated successfully, but these errors were encountered: