#34895 [Opn]: headers_list functionality regression
ID: 34895
User updated by: alex at weej dot com
Reported By: alex at weej dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: GNU Linux
PHP Version: 5.0.5
New Comment:
The documentation has been updated now.
Is there going to be a replacement function in the very near future? I
need this for a caching problem!
Previous Comments:
------------------------------------------------------------------------
[2005-10-17 18:39:08] alex at weej dot com
Description:
------------
The documented behaviour is exactly what I need for a project I am
working on, but now the behaviour has changed (even though the docs
haven't yet). :(
As far as I can see, there is no way to tell what headers PHP is
sending and their values, now.
apache_response_headers() is /not/ a replacement, as it omits
Content-Type (the most important header in my situation) and processes
the headers PHP passes to it. I really don't want to resort to wrapper
functions to maintain my own list. The documentation describes EXACTLY
the functionality I want.
I am upset! :(
http://uk.php.net/manual/en/function.headers-list.php
Reproduce code:
---------------
<?php
/* setcookie() will add a response header on its own */
setcookie('foo', 'bar');
/* Define a custom response header
This will be ignored by most clients */
header("X-Sample-Test: foo");
/* Specify plain text content in our response */
header('Content-type: text/plain');
/* What headers are going to be sent? */
var_dump(headers_list());
?>
Expected result:
----------------
array(4) {
[0]=>
string(29) "X-Powered-By: PHP/5.0.0"
[1]=>
string(19) "Set-Cookie: foo=bar"
[2]=>
string(18) "X-Sample-Test: foo"
[3]=>
string(24) "Content-type: text/plain"
}
Actual result:
--------------
array(4) {
[0]=>
string(12) "X-Powered-By"
[1]=>
string(10) "Set-Cookie"
[2]=>
string(13) "X-Sample-Test"
[3]=>
string(12) "Content-Type"
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34895&edit=1
Thread (6 messages)