Add proper content-length or transfer-encoding headers.