diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java index a862eb66704d4..53d97a8f6973b 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientResponseCompleteRestHandler.java @@ -120,6 +120,9 @@ public static ResponseImpl mapToResponse(RestClientRequestContext context, if (entity != null) { builder.entity(entity); } + if (entity != null) { + entityStream.close(); + } } } } else { diff --git a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java index e326aa202e6e8..2d0392166403d 100644 --- a/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java +++ b/independent-projects/resteasy-reactive/client/runtime/src/main/java/org/jboss/resteasy/reactive/client/handlers/ClientSendRequestHandler.java @@ -358,7 +358,7 @@ public void handle(AsyncResult ar) { try { if (buffer.length() > 0) { requestContext.setResponseEntityStream( - new ByteBufInputStream(buffer.getByteBuf())); + new ByteBufInputStream(buffer.getByteBuf(), true)); } else { requestContext.setResponseEntityStream(null); }