--- sapi/apache2handler/sapi_apache2.c.orig 2010-02-04 11:47:48.000000000 -0800 +++ sapi/apache2handler/sapi_apache2.c 2010-02-04 11:50:40.000000000 -0800 @@ -119,6 +119,8 @@ efree(ctx->content_type); } ctx->content_type = estrdup(val); + } else if (!strcasecmp(sapi_header->header, "content-length")) { + ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10)); } else if (op == SAPI_HEADER_REPLACE) { apr_table_set(ctx->r->headers_out, sapi_header->header, val); } else { --- sapi/apache/mod_php5.c.orig 2010-02-04 12:12:46.000000000 -0800 +++ sapi/apache/mod_php5.c 2010-02-04 12:15:45.000000000 -0800 @@ -196,6 +196,8 @@ if (!strcasecmp(header_name, "Content-Type")) { r->content_type = pstrdup(r->pool, header_content); + } else if (!strcasecmp(header_name, "Content-Length")) { + ap_set_content_length(r, strtol(header_content, (char **)NULL, 10)); } else if (!strcasecmp(header_name, "Set-Cookie")) { table_add(r->headers_out, header_name, header_content); } else if (op == SAPI_HEADER_REPLACE) { --- sapi/apache2filter/sapi_apache2.c.orig 2010-02-05 10:14:02.000000000 -0800 +++ sapi/apache2filter/sapi_apache2.c 2010-02-05 10:15:00.000000000 -0800 @@ -127,6 +127,8 @@ if (!strcasecmp(sapi_header->header, "content-type")) ctx->r->content_type = apr_pstrdup(ctx->r->pool, val); + else if (!strcasecmp(sapi_header->header, "content-length")) + ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10)); else if (op == SAPI_HEADER_REPLACE) apr_table_set(ctx->r->headers_out, sapi_header->header, val); else