#43843 [NEW]: Documentation sites return HTTP/1.1 even if 1.0 requested -> Garbage in Output
[email protected] ("php dot net at thermoman dot de")
| Newsgroups | php.webmaster |
|---|---|
| Message-ID | <[email protected]> |
From: php dot net at thermoman dot de
Operating system: Irrelevant
PHP version: Irrelevant
PHP Bug Type: Website problem
Bug description: Documentation sites return HTTP/1.1 even if 1.0 requested -> Garbage in Output
Description:
------------
On php.net Doc sites (e.g. http://php.net/print_r) the scripts return a
HTTP/1.1 header even if the client requested HTTP/1.0
This leads to Content-Transfer-Encoding metadata being inserted into the
websites body.
Reproduce code:
---------------
$ telnet php3.de 80
Trying 217.160.72.57...
Connected to php3.de.
Escape character is '^]'.
HEAD /print_r HTTP/1.0
Connection: close
Host: de3.php.net
HTTP/1.1 200 OK
[..]
Expected result:
----------------
HTTP/1.0 200 OK
Actual result:
--------------
The header is generated at this point:
== schnipp ==
// Send out a proper status header
function status_header($num)
{
// Set status text
switch ($num) {
case 200: $status = "OK"; break;
case 301: $status = "Moved Permanently"; break;
case 302: $status = "Found"; break;
case 404: $status = "Not Found"; break;
default: return FALSE;
}
// BC code for PHP < 4.3.0
@header("HTTP/1.1 $num $status");
@header("Status: $num $status", TRUE, $num);
return TRUE;
}
== schnapp ==
See http://trac.wordpress.org/ticket/3886 for the exact same problem
including a patch for older wordpress versions.
Here is a screenshot of the website with garbage in it when requested via
squid proxy server with HTTP/1.0:
http://test.thermoman.de/images/php_net_chunked_error.png
Please cross-reference bug #42402.
Credits to Timm Friebe for the deeper look inside.
--
Edit bug report at http://bugs.php.net/?id=43843&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43843&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43843&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43843&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43843&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=43843&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=43843&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=43843&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=43843&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=43843&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=43843&r=support
Expected behavior: http://bugs.php.net/fix.php?id=43843&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=43843&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=43843&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=43843&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43843&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=43843&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=43843&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=43843&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=43843&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=43843&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=43843&r=mysqlcfg