]> granicus.if.org Git - apache/commitdiff
* server/protocol.c (ap_read_request): Remove the Content-Length
authorJoe Orton <jorton@apache.org>
Thu, 23 Jun 2005 09:36:16 +0000 (09:36 +0000)
committerJoe Orton <jorton@apache.org>
Thu, 23 Jun 2005 09:36:16 +0000 (09:36 +0000)
header if any Transfer-Encoding header is present, regardless of
value.

Reviewed by: Paul Querna, Jeff Trawick

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@193122 13f79535-47bb-0310-9956-ffa450edef68

server/protocol.c

index 050de39e822d869ee28810733ff9fd202fa46d84..4efe8c44a942964ea5a3ccfdc2ace63a0aa9fec4 100644 (file)
@@ -899,16 +899,13 @@ request_rec *ap_read_request(conn_rec *conn)
             return r;
         }
 
-        if (apr_table_get(r->headers_in, "Content-Length")) {
-            const char* te = apr_table_get(r->headers_in, "Transfer-Encoding");
-            /*
-             * If the client sent any Transfer-Encoding besides "identity",
-             * the RFC says we MUST ignore the C-L header.  We kill it here
-             * to prevent more work later on in modules like mod_proxy.
-             */
-            if (te && strcasecmp("identity", te) != 0) {
-                apr_table_unset(r->headers_in, "Content-Length");
-            }
+        if (apr_table_get(r->headers_in, "Transfer-Encoding")
+            && apr_table_get(r->headers_in, "Content-Length")) {
+            /* 2616 section 4.4, point 3: "if both Transfer-Encoding
+             * and Content-Length are received, the latter MUST be
+             * ignored"; so unset it here to prevent any confusion
+             * later. */
+            apr_table_unset(r->headers_in, "Content-Length");
         }
     }
     else {