Skip to content
Browse files

Fix bug #50940

  • Loading branch information...
1 parent 3a239b1 commit 1947334023c101fb1ad455dd0e18d44dd5a2ec94 @rlerdorf rlerdorf committed Feb 5, 2010
Showing with 8 additions and 0 deletions.
  1. +2 −0 NEWS
  2. +2 −0 sapi/apache/mod_php5.c
  3. +2 −0 sapi/apache2filter/sapi_apache2.c
  4. +2 −0 sapi/apache2handler/sapi_apache2.c
View
2 NEWS
@@ -23,6 +23,8 @@ PHP NEWS
links or invalid paths. (Pierre)
- Fixed error output to stderr on Windows. (Pierre)
+- Fixed bug #50940 Custom content-length set incorrectly in Apache sapis.
+ (Brian France, Rasmus)
- Fixed bug #50907 (X-PHP-Originating-Script adding two new lines in *NIX).
(Ilia)
- Fixed bug #50859 (build fails with openssl 1.0 due to md2 deprecation).
View
2 sapi/apache/mod_php5.c
@@ -196,6 +196,8 @@ static int sapi_apache_header_handler(sapi_header_struct *sapi_header, sapi_head
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) {
View
2 sapi/apache2filter/sapi_apache2.c
@@ -127,6 +127,8 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
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
View
2 sapi/apache2handler/sapi_apache2.c
@@ -119,6 +119,8 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
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 {

0 comments on commit 1947334

Please sign in to comment.
Something went wrong with that request. Please try again.