php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30502 Duplicated headers + missing headers in response
Submitted: 2004-10-20 21:22 UTC Modified: 2005-03-15 01:00 UTC
Votes:5
Avg. Score:4.0 ± 0.9
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:2 (40.0%)
From: glideraerobatics at hotmail dot com Assigned:
Status: No Feedback Package: HTTP related
PHP Version: 5.0.2 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: glideraerobatics at hotmail dot com
New email:
PHP Version: OS:

 

 [2004-10-20 21:22 UTC] 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"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-07 22:21 UTC] sniper@php.net
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


 [2005-03-15 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC