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

Skip to content

Commit 0d477e9

Browse files
[HttpClient] fix checking for recent curl consts
1 parent a7e4494 commit 0d477e9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/Symfony/Component/HttpClient/CurlHttpClient.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,6 @@ private function validateExtraCurlOptions(array $options): void
439439
\CURLOPT_INFILESIZE => 'body',
440440
\CURLOPT_POSTFIELDS => 'body',
441441
\CURLOPT_UPLOAD => 'body',
442-
\CURLOPT_PINNEDPUBLICKEY => 'peer_fingerprint',
443-
\CURLOPT_UNIX_SOCKET_PATH => 'bindto',
444442
\CURLOPT_INTERFACE => 'bindto',
445443
\CURLOPT_TIMEOUT_MS => 'max_duration',
446444
\CURLOPT_TIMEOUT => 'max_duration',
@@ -463,6 +461,14 @@ private function validateExtraCurlOptions(array $options): void
463461
\CURLOPT_PROGRESSFUNCTION => 'on_progress',
464462
];
465463

464+
if (\defined('CURLOPT_UNIX_SOCKET_PATH')) {
465+
$curloptsToConfig[\CURLOPT_UNIX_SOCKET_PATH] = 'bindto';
466+
}
467+
468+
if (\defined('CURLOPT_PINNEDPUBLICKEY')) {
469+
$curloptsToConfig[\CURLOPT_PINNEDPUBLICKEY] = 'peer_fingerprint';
470+
}
471+
466472
$curloptsToCheck = [
467473
\CURLOPT_PRIVATE,
468474
\CURLOPT_HEADERFUNCTION,

0 commit comments

Comments
 (0)