Skip to content

Commit

Permalink
bug symfony#44743 [HttpClient] fix checking for recent curl consts (n…
Browse files Browse the repository at this point in the history
…icolas-grekas)

This PR was merged into the 5.3 branch.

Discussion
----------

[HttpClient] fix checking for recent curl consts

| Q             | A
| ------------- | ---
| Branch?       | 5.3
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix symfony#42061
| License       | MIT
| Doc PR        | -

Commits
-------

0d477e9 [HttpClient] fix checking for recent curl consts
  • Loading branch information
nicolas-grekas committed Dec 22, 2021
2 parents d3eeb83 + 0d477e9 commit 6b8b4ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/Symfony/Component/HttpClient/CurlHttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,6 @@ private function validateExtraCurlOptions(array $options): void
\CURLOPT_INFILESIZE => 'body',
\CURLOPT_POSTFIELDS => 'body',
\CURLOPT_UPLOAD => 'body',
\CURLOPT_PINNEDPUBLICKEY => 'peer_fingerprint',
\CURLOPT_UNIX_SOCKET_PATH => 'bindto',
\CURLOPT_INTERFACE => 'bindto',
\CURLOPT_TIMEOUT_MS => 'max_duration',
\CURLOPT_TIMEOUT => 'max_duration',
Expand All @@ -463,6 +461,14 @@ private function validateExtraCurlOptions(array $options): void
\CURLOPT_PROGRESSFUNCTION => 'on_progress',
];

if (\defined('CURLOPT_UNIX_SOCKET_PATH')) {
$curloptsToConfig[\CURLOPT_UNIX_SOCKET_PATH] = 'bindto';
}

if (\defined('CURLOPT_PINNEDPUBLICKEY')) {
$curloptsToConfig[\CURLOPT_PINNEDPUBLICKEY] = 'peer_fingerprint';
}

$curloptsToCheck = [
\CURLOPT_PRIVATE,
\CURLOPT_HEADERFUNCTION,
Expand Down

0 comments on commit 6b8b4ab

Please sign in to comment.