You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by jo...@apache.org on 2005/06/23 11:36:17 UTC
svn commit: r193122 - /httpd/httpd/trunk/server/protocol.c
Author: jorton
Date: Thu Jun 23 02:36:16 2005
New Revision: 193122
URL: http://svn.apache.org/viewcvs?rev=193122&view=rev
Log:
* server/protocol.c (ap_read_request): Remove the Content-Length
header if any Transfer-Encoding header is present, regardless of
value.
Reviewed by: Paul Querna, Jeff Trawick
Modified:
httpd/httpd/trunk/server/protocol.c
Modified: httpd/httpd/trunk/server/protocol.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/protocol.c?rev=193122&r1=193121&r2=193122&view=diff
==============================================================================
--- httpd/httpd/trunk/server/protocol.c (original)
+++ httpd/httpd/trunk/server/protocol.c Thu Jun 23 02:36:16 2005
@@ -899,16 +899,13 @@
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 {