Skip to content

Commit

Permalink
Merge branch '5.4' into 6.4
Browse files Browse the repository at this point in the history
* 5.4:
  Adjust PR template
  [HttpClient] Disable HTTP/2 PUSH by default when using curl
  Bump Symfony version to 5.4.43
  Update VERSION for 5.4.42
  Update CONTRIBUTORS for 5.4.42
  Update CHANGELOG for 5.4.42
  • Loading branch information
xabbuh committed Jul 30, 2024
2 parents b5e498f + 550cc67 commit 65b8a96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface,
*
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
*/
public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 50)
public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 0)
{
if (!\extension_loaded('curl')) {
throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\CurlHttpClient" as the "curl" extension is not installed.');
Expand Down
12 changes: 7 additions & 5 deletions Tests/CurlHttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@ class CurlHttpClientTest extends HttpClientTestCase
{
protected function getHttpClient(string $testCase): HttpClientInterface
{
if (str_contains($testCase, 'Push')) {
if (!\defined('CURLMOPT_PUSHFUNCTION') || 0x073D00 > ($v = curl_version())['version_number'] || !(\CURL_VERSION_HTTP2 & $v['features'])) {
$this->markTestSkipped('curl <7.61 is used or it is not compiled with support for HTTP/2 PUSH');
}
if (!str_contains($testCase, 'Push')) {
return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false]);
}

return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false]);
if (!\defined('CURLMOPT_PUSHFUNCTION') || 0x073D00 > ($v = curl_version())['version_number'] || !(\CURL_VERSION_HTTP2 & $v['features'])) {
$this->markTestSkipped('curl <7.61 is used or it is not compiled with support for HTTP/2 PUSH');
}

return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false], 6, 50);
}

public function testBindToPort()
Expand Down

0 comments on commit 65b8a96

Please sign in to comment.