|
|
|
@ -99,12 +99,10 @@ public class ModifyResponseBodyGatewayFilterFactory
@@ -99,12 +99,10 @@ public class ModifyResponseBodyGatewayFilterFactory
|
|
|
|
|
return bodyInserter.insert(outputMessage, new BodyInserterContext()) |
|
|
|
|
.then(Mono.defer(() -> { |
|
|
|
|
Flux<DataBuffer> messageBody = outputMessage.getBody(); |
|
|
|
|
//TODO: if (inputStream instanceof Mono) {
|
|
|
|
|
HttpHeaders headers = getDelegate().getHeaders(); |
|
|
|
|
if (/*headers.getContentLength() < 0 &&*/ !headers.containsKey(HttpHeaders.TRANSFER_ENCODING)) { |
|
|
|
|
if (!headers.containsKey(HttpHeaders.TRANSFER_ENCODING)) { |
|
|
|
|
messageBody = messageBody.doOnNext(data -> headers.setContentLength(data.readableByteCount())); |
|
|
|
|
} |
|
|
|
|
// }
|
|
|
|
|
//TODO: use isStreamingMediaType?
|
|
|
|
|
return getDelegate().writeWith(messageBody); |
|
|
|
|
})); |
|
|
|
|