Compute Content-Length header