Skip to content

Commit 08bc959

Browse files
committed
Merge branch '6.1.x'
2 parents 4e6532f + b242217 commit 08bc959

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spring-web/src/main/java/org/springframework/http/client/ReactorNettyClientResponse.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.springframework.http.HttpStatusCode;
2828
import org.springframework.http.support.Netty4HeadersAdapter;
2929
import org.springframework.lang.Nullable;
30+
import org.springframework.util.StreamUtils;
3031

3132
/**
3233
* {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client.
@@ -89,7 +90,13 @@ public InputStream getBody() throws IOException {
8990

9091
@Override
9192
public void close() {
92-
this.connection.dispose();
93+
try{
94+
InputStream body = getBody();
95+
StreamUtils.drain(body);
96+
body.close();
97+
}
98+
catch (IOException ignored) {
99+
}
93100
}
94101

95102
}

0 commit comments

Comments
 (0)