[php-src] Issue #7777: Cli-server mode cannot send Access-Control-Allow-Origin header
| From: | damianwadley | Date: | Wed, 15 Dec 2021 04:33:02 +0000 |
| Subject: | [php-src] Issue #7777: Cli-server mode cannot send Access-Control-Allow-Origin header | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-238421@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/7777
Comment Author: damianwadley
Works for me in PHP 7.4.26.
```
ubuntu:~/php$ cat gh7777.php
<?php
header('Access-Control-Allow-Origin: *');
header("Access-Control-Expose-Headers: Content-Disposition");
header('Access-Control-Origin: xxx.hoo.com');
die('header test');
ubuntu:~/php$ jobs
[1]+ Running php-7.4.26/bin/php -S localhost:8000 -t . 2> /dev/null &
ubuntu:~/php$ curl -I http://localhost:8000/gh7777.php
HTTP/1.1 200 OK
Host: localhost:8000
Date: Wed, 15 Dec 2021 04:30:17 GMT
Connection: close
X-Powered-By: PHP/7.4.26
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: Content-Disposition
Access-Control-Origin: xxx.hoo.com
Content-type: text/html; charset=UTF-8
```
Your 7.4.3 is old. Try again with a more recent version.
If not then include the php CLI command you used and, as the bug template said, the _actual_ outputs
of what you saw running curl.