[php-src] Issue #9316: contents of $http_response_header is incorrect with long http message

From: Date: Fri, 12 Aug 2022 14:00:11 +0000
Subject: [php-src] Issue #9316: contents of $http_response_header is incorrect with long http message
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-242199@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/9316 Author: fasterforward ### Description The following code: ```php echo file_get_contents('https://secret.blob.core.windows.net/container/documents/899/00000898942?si=secret&spr=https&sv=2021-06-08&sr=c&sig=secret'); print_r($http_response_header); ``` Resulted in this output: ``` Array ( [0] => HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly includ [1] => ing the signature. [2] => Content-Length: 544 [3] => Content-Type: application/xml [4] => Server: Microsoft-HTTPAPI/2.0 [5] => x-ms-request-id: 62435059-d01e-0017-2c51-aea046000000 [6] => x-ms-error-code: AuthenticationFailed [7] => Date: Fri, 12 Aug 2022 13:45:53 GMT [8] => Connection: close ) ``` But I expected this output instead: ``` Array ( [0] => HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. [1] => Content-Length: 544 [2] => Content-Type: application/xml [3] => Server: Microsoft-HTTPAPI/2.0 [4] => x-ms-request-id: 62435059-d01e-0017-2c51-aea046000000 [5] => x-ms-error-code: AuthenticationFailed [6] => Date: Fri, 12 Aug 2022 13:45:53 GMT [7] => Connection: close ) ``` Here are the raw response headers according to network tab of FireFox: ``` HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. Content-Length: 544 Content-Type: application/xml Server: Microsoft-HTTPAPI/2.0 x-ms-request-id: d9fdcb88-f01e-0022-4551-ae0e13000000 x-ms-error-code: AuthenticationFailed Date: Fri, 12 Aug 2022 13:42:57 GMT ``` ### PHP Version PHP 8.1 ### Operating System _No response_

« previous php.bugs (#242199) next »