// We just need to reset the readerIndex this time
if (buffer.readerIndex() == buffer.writerIndex()) {
buffer.setIndex(0, buffer.writerIndex());
}
// TODO How to enable the chunk transport
int len = buffer.readableBytes();
// set content-length
response.headers().set(HttpHeaders.Names.CONTENT_LENGTH, len);
LOG.trace("Content-Length: {}", len);
} else {
response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1, HttpResponseStatus.valueOf(code));