--- jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java	(revision 531784)
+++ jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Request.java	(working copy)
@@ -309,7 +309,7 @@
     public long getContentLengthLong() {
         if( contentLength > -1 ) return contentLength;
 
-        MessageBytes clB = headers.getValue("content-length");
+        MessageBytes clB = headers.getUniqueValue("content-length");
         contentLength = (clB == null || clB.isNull()) ? -1 : clB.getLong();
 
         return contentLength;
--- jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/MimeHeaders.java	(revision 531784)
+++ jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/http/MimeHeaders.java	(working copy)
@@ -286,6 +286,25 @@
         return null;
     }
 
+    /**
+     * Finds and returns a unique header field with the given name. If no such
+     * field exists, null is returned. If the specified header field is not
+     * unique then an {@link IllegalArgumentException} is thrown.
+     */
+    public MessageBytes getUniqueValue(String name) {
+        MessageBytes result = null;
+        for (int i = 0; i < count; i++) {
+            if (headers[i].getName().equalsIgnoreCase(name)) {
+                if (result == null) {
+                    result = headers[i].getValue();
+                } else {
+                    throw new IllegalArgumentException();
+                }
+            }
+        }
+        return result;
+    }
+
     // bad shortcut - it'll convert to string ( too early probably,
     // encoding is guessed very late )
     public String getHeader(String name) {
