Removes commented out code

This commit is contained in:
Spencer Gibb
2018-08-17 01:27:12 -04:00
parent 7b6ec3cef9
commit 8ecc912584

View File

@@ -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)) {
messageBody = messageBody.doOnNext(data -> headers.setContentLength(data.readableByteCount()));
}
// }
HttpHeaders headers = getDelegate().getHeaders();
if (!headers.containsKey(HttpHeaders.TRANSFER_ENCODING)) {
messageBody = messageBody.doOnNext(data -> headers.setContentLength(data.readableByteCount()));
}
//TODO: use isStreamingMediaType?
return getDelegate().writeWith(messageBody);
}));