Skip to content

Commit 1243f89

Browse files
Merge branch '5.0'
* 5.0: [VarDumper] fix for change in PHP 7.4.6 Added regression test for AccountStatusException behavior (ref #36822) [HttpClient] fix PHP warning + accept status code >= 600 [Security/Core] fix compat of `NativePasswordEncoder` with pre-PHP74 values of `PASSWORD_*` consts embed resource name in error message [FrameworkBundle] fix stringable annotation Change priority of KernelEvents::RESPONSE subscriber Fix register event listeners compiler pass Missing description in `messenger:setup-transports` command [Serializer] fix issue with PHP 8 [WebProfiler] Remove 'none' when appending CSP tokens [TwigBundle] FormExtension does not have a constructor anymore since sf 4.0 [Yaml] Fix escaped quotes in quoted multi-line string
2 parents 72a4784 + 64dba4b commit 1243f89

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Response/CurlResponse.php

+9-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,15 @@ private static function parseHeaderLine($ch, string $data, array &$info, array &
312312
}
313313

314314
if ("\r\n" !== $data) {
315-
// Regular header line: add it to the list
316-
self::addResponseHeaders([substr($data, 0, -2)], $info, $headers);
315+
try {
316+
// Regular header line: add it to the list
317+
self::addResponseHeaders([substr($data, 0, -2)], $info, $headers);
318+
} catch (TransportException $e) {
319+
$multi->handlesActivity[$id][] = null;
320+
$multi->handlesActivity[$id][] = $e;
321+
322+
return \strlen($data);
323+
}
317324

318325
if (0 !== strpos($data, 'HTTP/')) {
319326
if (0 === stripos($data, 'Location:')) {

Response/ResponseTrait.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ private static function initialize(self $response): void
253253
private static function addResponseHeaders(array $responseHeaders, array &$info, array &$headers, string &$debug = ''): void
254254
{
255255
foreach ($responseHeaders as $h) {
256-
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([12345]\d\d)(?: |$)#', $h, $m)) {
256+
if (11 <= \strlen($h) && '/' === $h[4] && preg_match('#^HTTP/\d+(?:\.\d+)? ([1-9]\d\d)(?: |$)#', $h, $m)) {
257257
if ($headers) {
258258
$debug .= "< \r\n";
259259
$headers = [];

0 commit comments

Comments
 (0)