Skip to content

Commit

Permalink
Merge branch '4.4' into 5.3
Browse files Browse the repository at this point in the history
* 4.4:
  [HttpClient] accept headers when CURLE_RECV_ERROR is received before the content
  Use PHPUnit 9.5 on PHP 8.1
  • Loading branch information
nicolas-grekas committed Sep 30, 2021
2 parents c6370fe + a45fa15 commit f3eee49
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Response/CurlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,10 @@ private static function perform(ClientState $multi, array &$responses = null): v
}
}

if (\CURLE_RECV_ERROR === $result && 'H' === $waitFor[0] && 400 <= ($responses[(int) $ch]->info['http_code'] ?? 0)) {
$multi->handlesActivity[$id][] = new FirstChunk();
}

$multi->handlesActivity[$id][] = null;
$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)));
}
Expand Down

0 comments on commit f3eee49

Please sign in to comment.