Req #65917 [Opn]: getallheaders() is not supported by the built-in web server

From: Date: Thu, 17 Oct 2013 18:48:53 +0000
Subject: Req #65917 [Opn]: getallheaders() is not supported by the built-in web server
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-182330@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=65917&edit=1

 ID:                 65917
 User updated by:    ajf at ajf dot me
 Reported by:        ajf at ajf dot me
 Summary:            getallheaders() is not supported by the built-in web
                     server
 Status:             Open
 Type:               Feature/Change Request
 Package:            Built-in web server
 Operating System:   Windows, Linux
 PHP Version:        5.4.20
 Block user comment: N
 Private report:     N

 New Comment:

I'm extending this request to include apache_response_headers() as well as
apache_request_headers() (which getallheaders() is but an alias of).


Previous Comments:
------------------------------------------------------------------------
[2013-10-16 16:47:26] ajf at ajf dot me

Description:
------------
The built-in CLI web server does not support getallheaders(). Given that projects may need to
support headers unavailable in $_SERVER and that both Apache and FastCGI support it, it is
unfortunate that the CLI web server does not.

I expect this would not be difficult to implement, considering that the CLI web server likely
already has this information at its disposal.

Test script:
---------------
<?php
// The header() is just so that var_dump()'s output looks good in browser
// I'm aware that getallheaders() gets *request* headers
header('Content-Type: text/plain');
var_dump(getallheaders());

Expected result:
----------------
array(0) {
  ...
}

Actual result:
--------------
<br />
<b>Fatal error</b>:  Call to undefined function getallheaders() in
<b>D:\Projects\test.php</b> on line <b>3</b><br />


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=65917&edit=1


Thread (3 messages)

« previous php.bugs (#182330) next »