Merge branch '6.1.x'

This commit is contained in:
Arjen Poutsma 2024-04-05 15:43:49 +02:00
commit 08bc959c9b
1 changed files with 8 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpStatusCode; import org.springframework.http.HttpStatusCode;
import org.springframework.http.support.Netty4HeadersAdapter; import org.springframework.http.support.Netty4HeadersAdapter;
import org.springframework.lang.Nullable; import org.springframework.lang.Nullable;
import org.springframework.util.StreamUtils;
/** /**
* {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client. * {@link ClientHttpResponse} implementation for the Reactor-Netty HTTP client.
@ -89,7 +90,13 @@ final class ReactorNettyClientResponse implements ClientHttpResponse {
@Override @Override
public void close() { public void close() {
this.connection.dispose(); try{
InputStream body = getBody();
StreamUtils.drain(body);
body.close();
}
catch (IOException ignored) {
}
} }
} }