#30502 [Opn->Fbk]: Duplicated headers + missing headers in response
| From: | sniper@php.net | Date: | Mon, 07 Mar 2005 21:21:39 +0000 |
| Subject: | #30502 [Opn->Fbk]: Duplicated headers + missing headers in response | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-75075@lists.php.net to get a copy of this message | ||
ID: 30502
Updated by: sniper@php.net
Reported By: glideraerobatics at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: HTTP related
Operating System: Linux
PHP Version: 5.0.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2004-10-20 21:22:34] glideraerobatics at hotmail dot com
Description:
------------
I've noticed numerous times that certain headers produced by PHP
scripts are duplicated. Another problem is that the Content-Length
header is set in code, but is missing in the output.
See below the expected and actual responses. Actual response discards
the Content-Length header and duplicates the Content-Disposition
header.
I sent this request to the PHP script to test it:
HEAD /download.php/458/Cats_in_the_Cradle.mid HTTP/1.1
Host: wapxtc.nl
accept-language: nl
user-agent: SonyEricssonT230/R101
cache-control: no-cache
accept: text/vnd.wap.wml,text/vnd.wap.wmlscript,*/*;q=0.001
accept-charset: us-ascii,iso-8859-1,utf-8,iso-10646-ucs-2,*;q=0.001
accept-encoding: *;q=0.001
FYI: I'm running Apache 2 (stable) on PHP5.02 (stable) on Linux.
Reproduce code:
---------------
// $data contains blob
header('Content-Length: ' . strlen($data));
header('Content-Type: ' . $item['MIMETYPE']);
header('Content-Disposition: inline; filename="' . $filename . '"');
// This outputs the 3 lines above in the error_log as expected:
error_log(implode("\n",headers_list()));
if ($_SERVER['REQUEST_METHOD'] != 'HEAD') {
print $data;
}
exit;
Expected result:
----------------
HTTP/1.1 200 OK
Content-Disposition: inline; filename="Cats_in_the_Cradle.mid"
Last-Modified: Mon, 18 Oct 2004 13:23:52 GMT
Content-Type: audio/midi
Content-Length: 6331
Actual result:
--------------
HTTP/1.1 200 OK
Content-Disposition: inline; filename="Cats_in_the_Cradle.mid"
Last-Modified: Mon, 18 Oct 2004 13:23:52 GMT
Content-Type: audio/midi
Content-Disposition: inline; filename="Cats_in_the_Cradle.mid"
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30502&edit=1