response.addHeader(new Header(HttpConstants.HEADER_CONTENT_TYPE,
HttpConstants.DEFAULT_CONTENT_TYPE));
}
// Ensure there's a content length or transfer encoding header
if (!response.containsHeader(HttpConstants.HEADER_CONTENT_LENGTH)
&& !response.containsHeader(HttpConstants.HEADER_TRANSFER_ENCODING))
{
if (response.hasBody())
{
long len = response.getContentLength();