From 6f32ff489ab66f144c4a9222e6d3cb482efceb24 Mon Sep 17 00:00:00 2001 From: Arjen Poutsma <arjen.poutsma@broadcom.com> Date: Thu, 13 Jun 2024 11:10:50 +0200 Subject: [PATCH] Use null stream in ReactorNettyClientResponse if no body is available Closes gh-32805 --- .../springframework/http/client/ReactorNettyClientResponse.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java index 4c314d133839..9d1b18a25252 100644 --- a/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java +++ b/spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java @@ -88,7 +88,7 @@ public InputStream getBody() throws IOException { } if (body == null) { - throw new IOException("Could not receive body"); + body = InputStream.nullInputStream(); } this.body = body; return body;