Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1f34133

Browse files
[HttpClient] Disable HTTP/2 PUSH by default when using curl
1 parent f3e0c81 commit 1f34133

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ final class CurlHttpClient implements HttpClientInterface, LoggerAwareInterface,
6767
*
6868
* @see HttpClientInterface::OPTIONS_DEFAULTS for available options
6969
*/
70-
public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 50)
70+
public function __construct(array $defaultOptions = [], int $maxHostConnections = 6, int $maxPendingPushes = 0)
7171
{
7272
if (!\extension_loaded('curl')) {
7373
throw new \LogicException('You cannot use the "Symfony\Component\HttpClient\CurlHttpClient" as the "curl" extension is not installed.');

src/Symfony/Component/HttpClient/Tests/CurlHttpClientTest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ protected function getHttpClient(string $testCase): HttpClientInterface
3232
}
3333
}
3434

35+
if (str_contains($testCase, 'Push')) {
36+
return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false], 6, 50);
37+
}
38+
3539
return new CurlHttpClient(['verify_peer' => false, 'verify_host' => false]);
3640
}
3741

0 commit comments

Comments
 (0)