Req->Bug #78844 [Opn]: FPM does not support multiple HTTP request headers with the same name
| From: | requinix@php.net | Date: | Wed, 20 Nov 2019 19:03:45 +0000 |
| Subject: | Req->Bug #78844 [Opn]: FPM does not support multiple HTTP request headers with the same name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223818@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78844&edit=1
ID: 78844
Updated by: requinix@php.net
Reported by: mikk150 at gmail dot com
-Summary: Ability to get all client sent HTTP headers
+Summary: FPM does not support multiple HTTP request headers
with the same name
Status: Open
-Type: Feature/Change Request
+Type: Bug
-Package: *Web Server problem
+Package: FPM related
Operating System: Linux
PHP Version: 7.3.11
Block user comment: N
Private report: N
New Comment:
The ability to get headers is highly dependent on the SAPI. Apache's works nicely, but php -s
is just a quick development server that is not going to be suitable for all purposes.
So really, the issue here is that php-fpm doesn't properly handle multiple headers. The HTTP
spec requires that multiple headers only be allowed when their values can be combined into
comma-separated lists, which means $_SERVER and getallheaders() are still sufficient.
Previous Comments:
------------------------------------------------------------------------
[2019-11-20 18:44:40] mikk150 at gmail dot com
summary more understandable
------------------------------------------------------------------------
[2019-11-20 17:39:23] mikk150 at gmail dot com
Description:
------------
PHP $_SERVER['HTTP_*'] superglobal and getallheaders() does not actually give all headers.
If you have multiple header lines with same name, each SAPI does totally different thing(and all of
them are wrong)
If I make request:
GET / HTTP/1.1
Forwarded: for=10.0.0.1,for=20.30.40.50;host=php.net,host=awesome.proxy.com;proto=https,proto=http
Forwarded: for=10.30.20.10;host=second.awesome.proxy.com;proto=http
I get 3 different responses based on SAPI
FPM only keeps last header
php -s only keeps first header
apache concatenates them with ,
PHP should implement new method to get all headers OR implement some class that has method to get
all headers
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78844&edit=1