mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-17 16:39:29 +00:00
Merge branch '6.2.x'
This commit is contained in:
+6
-1
@@ -67,7 +67,12 @@ class JdkClientHttpResponse extends AbstractClientHttpResponse {
|
||||
private static Flux<DataBuffer> adaptBody(
|
||||
HttpResponse<Flow.Publisher<List<ByteBuffer>>> response, DataBufferFactory bufferFactory) {
|
||||
|
||||
return JdkFlowAdapter.flowPublisherToFlux(response.body())
|
||||
Flow.Publisher<List<ByteBuffer>> body = response.body();
|
||||
if (body == null) {
|
||||
return Flux.empty();
|
||||
}
|
||||
|
||||
return JdkFlowAdapter.flowPublisherToFlux(body)
|
||||
.flatMapIterable(Function.identity())
|
||||
.map(bufferFactory::wrap)
|
||||
.doOnDiscard(DataBuffer.class, DataBufferUtils::release)
|
||||
|
||||
Reference in New Issue
Block a user