[HttpClient] Fix strict parsing of response status codes

This commit is contained in:
Armando 2020-01-13 16:59:16 +01:00 committed by Nicolas Grekas
parent 1d25a25109
commit 4aa953600f

View File

@ -223,7 +223,7 @@ trait ResponseTrait
private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers, string &$debug = ''): void
{
foreach ($responseHeaders as $h) {
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d) .*#', $h, $m)) {
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d)(?: |$)#', $h, $m)) {
if ($headers) {
$debug .= "< \r\n";
$headers = [];