Last change
on this file since 1079 was
1035,
checked in by mitchb, 14 years ago
|
Fix "the-bug" (non-empty content in 304s) in PHP (patch by ezyang) and Apache
PHP should not produce any output, even if zlib.output_compression is
on, if the HTTP response code is 204 or 304 (no content or not modified).
Fixes PHP bug #42362 with php.cvs #56693, see:
http://bugs.php.net/bug.php?id=42362
http://news.php.net/php.cvs/56693
http://cvs.php.net/viewvc.cgi/php-src/ext/zlib/zlib.c?r1=1.183.2.6.2.5.2.9&r2=1.183.2.6.2.5.2.10
Apache should discard any body provided by a script (in any language, not
just PHP) when the status is "no content" or "not modified".
Addresses part of Apache bug #40953, see:
https://issues.apache.org/bugzilla/show_bug.cgi?id=40953#c7
Solves scripts.mit.edu support issue #773060, see:
https://help.mit.edu/Ticket/UpdateCallCenter.html?id=773060
https://diswww.mit.edu/charon/scripts/24018
|
File size:
722 bytes
|
Rev | Line | |
---|
[1035] | 1 | --- httpd-2.2.10/server/util_script.c.orig 2006-09-15 09:19:25.000000000 -0400 |
---|
| 2 | +++ httpd-2.2.10/server/util_script.c 2009-03-28 14:33:17.000000000 -0400 |
---|
| 3 | @@ -482,6 +482,11 @@ |
---|
| 4 | if ((cgi_status == HTTP_UNSET) && (r->method_number == M_GET)) { |
---|
| 5 | cond_status = ap_meets_conditions(r); |
---|
| 6 | } |
---|
| 7 | + else if ((cgi_status == HTTP_NO_CONTENT) || |
---|
| 8 | + (cgi_status == HTTP_NOT_MODIFIED) || |
---|
| 9 | + ap_is_HTTP_INFO(cgi_status)) { |
---|
| 10 | + r->header_only = 1; /* discard any body */ |
---|
| 11 | + } |
---|
| 12 | apr_table_overlap(r->err_headers_out, merge, |
---|
| 13 | APR_OVERLAP_TABLES_MERGE); |
---|
| 14 | if (!apr_is_empty_table(cookie_table)) { |
---|
Note: See
TracBrowser
for help on using the repository browser.