|
|
|
|
@ -98,7 +98,13 @@ class JdkClientHttpResponse extends AbstractClientHttpResponse {
@@ -98,7 +98,13 @@ 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) |
|
|
|
|
|