Skip to content

Commit f3eee49

Browse files
Merge branch '4.4' into 5.3
* 4.4: [HttpClient] accept headers when CURLE_RECV_ERROR is received before the content Use PHPUnit 9.5 on PHP 8.1
2 parents c6370fe + a45fa15 commit f3eee49

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Response/CurlResponse.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,10 @@ private static function perform(ClientState $multi, array &$responses = null): v
313313
}
314314
}
315315

316+
if (\CURLE_RECV_ERROR === $result && 'H' === $waitFor[0] && 400 <= ($responses[(int) $ch]->info['http_code'] ?? 0)) {
317+
$multi->handlesActivity[$id][] = new FirstChunk();
318+
}
319+
316320
$multi->handlesActivity[$id][] = null;
317321
$multi->handlesActivity[$id][] = \in_array($result, [\CURLE_OK, \CURLE_TOO_MANY_REDIRECTS], true) || '_0' === $waitFor || curl_getinfo($ch, \CURLINFO_SIZE_DOWNLOAD) === curl_getinfo($ch, \CURLINFO_CONTENT_LENGTH_DOWNLOAD) ? null : new TransportException(sprintf('%s for "%s".', curl_strerror($result), curl_getinfo($ch, \CURLINFO_EFFECTIVE_URL)));
318322
}

0 commit comments

Comments
 (0)