diff --git a/src/Symfony/Component/HttpClient/Response/CurlResponse.php b/src/Symfony/Component/HttpClient/Response/CurlResponse.php index 58528108e8d1a..80709ed8a6a76 100644 --- a/src/Symfony/Component/HttpClient/Response/CurlResponse.php +++ b/src/Symfony/Component/HttpClient/Response/CurlResponse.php @@ -312,8 +312,15 @@ private static function parseHeaderLine($ch, string $data, array &$info, array & } if ("\r\n" !== $data) { - // Regular header line: add it to the list - self::addResponseHeaders([substr($data, 0, -2)], $info, $headers); + try { + // Regular header line: add it to the list + self::addResponseHeaders([substr($data, 0, -2)], $info, $headers); + } catch (TransportException $e) { + $multi->handlesActivity[$id][] = null; + $multi->handlesActivity[$id][] = $e; + + return \strlen($data); + } if (0 !== strpos($data, 'HTTP/')) { if (0 === stripos($data, 'Location:')) { diff --git a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php index d0aee7a158649..786e995b16ffd 100644 --- a/src/Symfony/Component/HttpClient/Response/ResponseTrait.php +++ b/src/Symfony/Component/HttpClient/Response/ResponseTrait.php @@ -253,7 +253,7 @@ private static function initialize(self $response): void 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+)? ([1-9]\d\d)(?: |$)#', $h, $m)) { if ($headers) { $debug .= "< \r\n"; $headers = []; pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy