if (header.getProtocolVersion().equalsIgnoreCase("0.9") || header.getProtocolVersion().equalsIgnoreCase("1.0")) {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("[" + getId() + "] response is " + header.getProtocolVersion() + " version");
}
HttpResponseHeader newHeader;
if (header.getProtocolVersion().equalsIgnoreCase("0.9")) {
newHeader = new HttpResponseHeader(200);
} else {
newHeader = new HttpResponseHeader(header.getStatus());
}
newHeader.copyHeaderFrom(header);
header = newHeader;
}
// does caller support chunked response? if not convert it to length-based response
if (!AbstractHttpConnection.isAcceptingChunkedResponseBody(getRequest())) {
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("[" + getId() + "] the requestor does not support chunked response messages (request protocol: " + getRequest().getProtocol() + "). Converting chunked response into simple response.");
}
HttpResponseHeader newHeader = new HttpResponseHeader(header.getStatus(), header.getReason());
newHeader.copyHeaderFrom(header);
newHeader.setProtocol(getRequest().getProtocol());
newHeader.setHeader("Connection", "close");
header = newHeader;
} else {
header.setTransferEncoding("chunked");