|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-03-07 22:21 UTC] sniper@php.net
[2005-03-15 01:00 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 17:00:01 2025 UTC |
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"