[php-src] PR #12363: php_cli_server: ensure a single Date header is present
| From: | coppolafab | Date: | Thu, 05 Oct 2023 08:02:14 +0000 |
| Subject: | [php-src] PR #12363: php_cli_server: ensure a single Date header is present | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-23787@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/12363
Author: coppolafab
Currently the PHP Development Server appends a Date header in the response, despite already set from
user code.
### Steps to reproduce
index.php:
<?php header('Date: Mon, 25 Mar 1985 00:20:00 GMT');
terminal 1:
$ php -S localhost:8080 index.php
terminal 2:
```
$ curl -i localhost:8080
HTTP/1.1 200 OK
Host: localhost:8080
Date: Thu, 05 Oct 2023 07:45:57 GMT
Connection: close
X-Powered-By: PHP/8.2.10
Date: Mon, 25 Mar 1985 00:20:00 GMT
Content-type: text/html; charset=UTF-8
```
I have added a check condition before append the header, and a test file.