IHttpResponse httpResponse;
if (httpRequest.getVersion().isHTTP11()) {
httpResponse = new HttpResponse(HttpVersion.HTTP_11);
httpResponse.setConnectionType(ConnectionType.KEEP_ALIVE);
httpResponse.getHeaders().addHeader(new StringHttpHeader("Keep-Alive", "timeout=5, max=100"));
} else {
httpResponse = new HttpResponse(HttpVersion.HTTP_10);
httpResponse.setConnectionType(ConnectionType.CLOSE);
}