Correct Content-Length counting function.

Previously counted content length is larger than the actual content being submitted, which caused Chrome considered "failed" on retrieving the entire document.