[php-src] Issue #19560: 8.5 regression: Curl response headers doesn't respect space anymore in header key
| From: | HeenaBansal20 | Date: | Fri, 22 Aug 2025 19:27:38 +0000 |
| Subject: | [php-src] Issue #19560: 8.5 regression: Curl response headers doesn't respect space anymore in header key | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-250610@lists.php.net to get a copy of this message | ||
Issue: https://github.com/php/php-src/issues/19560
Author: HeenaBansal20
### Description
The following code:
I have a php script which adds the response headers back in curl response to return as response
headers.
```php
$response_headers = urlencode(
"Header1:VALUE1,"
. " Header2 : VALUE2 \n,"
. "Header3: \r\n,"
. "HeaderNotCaptured2:VALUE,"
. "Header4:,"
. " : , :,: ,:, \n , \n,\n ,\n, ,"
);
$url = "http://$address/?response_headers=$response_headers";
// Test curl_setopt
$ch1 = curl_init($url);
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
curl_exec($ch1);
<?php
```
Resulted in this output:
```
HEADER2 doesn't come up in response header lists. And removing leading space from HEADER2 works
and I could see header2 in response headers. it works well in PHP 8.4 .
```
### PHP Version
```plain
PHP 8.5.0beta1 (cli) (built: Aug 14 2025 22:20:47) (NTS DEBUG)
Copyright (c) The PHP Group
Zend Engine v4.5.0-dev, Copyright (c) Zend Technologies
with Zend OPcache v8.5.0beta1, Copyright (c), by Zend Technologies
```
### Operating System
_No response_