Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf024382

Browse files
bug#37484 [HttpClient][CurlHttpClient] Fix http_version option usage (fancyweb)
This PR was merged into the 4.4 branch.Discussion----------[HttpClient][CurlHttpClient] Fix http_version option usage| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets |#37402| License | MIT| Doc PR | -Ref#36422If the scheme is https, we should only set http version 2.0 if the http_version is not specified.Commits-------2676902 [HttpClient][CurlHttpClient] Fix http_version option usage
2 parents659699b +2676902 commitf024382

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/Symfony/Component/HttpClient/CurlHttpClient.php‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,12 @@ public function request(string $method, string $url, array $options = []): Respo
138138
CURLOPT_CERTINFO =>$options['capture_peer_cert_chain'],
139139
];
140140

141-
if (\defined('CURL_VERSION_HTTP2') && (CURL_VERSION_HTTP2 &self::$curlVersion['features']) && ('https:' ===$scheme ||2.0 === (float)$options['http_version'])) {
142-
$curlopts[CURLOPT_HTTP_VERSION] =CURL_HTTP_VERSION_2_0;
143-
}elseif (1.0 === (float)$options['http_version']) {
141+
if (1.0 === (float)$options['http_version']) {
144142
$curlopts[CURLOPT_HTTP_VERSION] =CURL_HTTP_VERSION_1_0;
145143
}elseif (1.1 === (float)$options['http_version']) {
146144
$curlopts[CURLOPT_HTTP_VERSION] =CURL_HTTP_VERSION_1_1;
145+
}elseif (\defined('CURL_VERSION_HTTP2') && (CURL_VERSION_HTTP2 &self::$curlVersion['features']) && ('https:' ===$scheme ||2.0 === (float)$options['http_version'])) {
146+
$curlopts[CURLOPT_HTTP_VERSION] =CURL_HTTP_VERSION_2_0;
147147
}
148148

149149
if (isset($options['auth_ntlm'])) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp