Added Content-Length header using a temporary buffer in response.