Ensure Content-Length header is set properly