private String doContentLengthReWrite(final String message) {

		// If we are not dealing with a POST, no need to rewrite
		if (!message.startsWith("POST")) {

			return message;

		}

		final String ENDCREDITS = END_LINE + END_LINE;
		// If no "end credits" have been found
		final int eoh = message.indexOf(ENDCREDITS);
		if(eoh == -1) {

			return message;

		}

		final String TOBEFOUND = "Content-Length:";
		// Find the location of the "Content-Length:"
		final int ctl = this.message.indexOf(TOBEFOUND);
		// Provided a content length character sequence exists in
		// the request
		if(ctl == -1) {

			// The message does not contain the Content-Length line and
			// this needs to be added
			// TODO Add the Content-Length line
			return message;

		}

		int contentLength = 0;
		final String postValue = message.substring(eoh + (ENDCREDITS).length());

		// Find the next end of line character, after the char to be found
		final int neol = this.message.indexOf(END_LINE, ctl);
		if(neol == -1) {

			return message;

		}

		// Retrieve the value until the next "END_LINE" character
		final String contLengthString = message.substring(ctl + TOBEFOUND.length(), neol);
		try {
			contentLength = Integer.parseInt(contLengthString);
		} catch (final NumberFormatException e) {
			contentLength = 0;
		}

		// If the content length is the same as the postValue in bytes
		if (contentLength == postValue.getBytes().length) {

			return message;

		}

		final StringBuffer newMsgBuffer = new StringBuffer();
		newMsgBuffer.append(message.substring(0, ctl + TOBEFOUND.length()));
		try {

			newMsgBuffer.append(' ');
			newMsgBuffer.append(postValue.getBytes("ISO-8859-1").length);

		} catch (final UnsupportedEncodingException e) {

			// TODO: Log this exception
			newMsgBuffer.append(' ');
			newMsgBuffer.append(postValue.getBytes().length);

		}

		// If the remaining header starts with "END_LINE" then the 
		// "Content-Length was the last header line
		final String remainingHeader = this.message.substring(neol, eoh + (ENDCREDITS).length());
		if (remainingHeader.startsWith(END_LINE)) {
			newMsgBuffer.append(END_LINE);
			newMsgBuffer.append(END_LINE);
		} else {
			newMsgBuffer.append(remainingHeader);
		}

		newMsgBuffer.append(postValue);

		return newMsgBuffer.toString();

	}