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

Appearance settings

Commit a04effa

Browse filesBrowse files
bug #41674 [HttpClient] fix compat with cURL <= 7.37 (nicolas-grekas)
This PR was merged into the 5.2 branch. Discussion ---------- [HttpClient] fix compat with cURL <= 7.37 | Q | A | ------------- | --- | Branch? | 5.2 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #41662 | License | MIT | Doc PR | - Commits ------- d8adf51 [HttpClient] fix compat with cURL <= 7.37
2 parents 610b51d + d8adf51 commit a04effa
Copy full SHA for a04effa

File tree

1 file changed

+5
-2
lines changed
Filter options

1 file changed

+5
-2
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpClient/CurlHttpClient.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function request(string $method, string $url, array $options = []): Respo
311311
}
312312

313313
foreach ($curlopts as $opt => $value) {
314-
if (null !== $value && !curl_setopt($ch, $opt, $value) && \CURLOPT_CERTINFO !== $opt) {
314+
if (null !== $value && !curl_setopt($ch, $opt, $value) && \CURLOPT_CERTINFO !== $opt && (!\defined('CURLOPT_HEADEROPT') || \CURLOPT_HEADEROPT !== $opt)) {
315315
$constantName = $this->findConstantName($opt);
316316
throw new TransportException(sprintf('Curl option "%s" is not supported.', $constantName ?? $opt));
317317
}
@@ -574,7 +574,6 @@ private function validateExtraCurlOptions(array $options): void
574574
\CURLOPT_HEADER,
575575
\CURLOPT_CONNECTTIMEOUT,
576576
\CURLOPT_CONNECTTIMEOUT_MS,
577-
\CURLOPT_HEADEROPT,
578577
\CURLOPT_HTTP_VERSION,
579578
\CURLOPT_PORT,
580579
\CURLOPT_DNS_USE_GLOBAL_CACHE,
@@ -588,6 +587,10 @@ private function validateExtraCurlOptions(array $options): void
588587
$curloptsToCheck[] = \CURLOPT_HTTP09_ALLOWED;
589588
}
590589

590+
if (\defined('CURLOPT_HEADEROPT')) {
591+
$curloptsToCheck[] = \CURLOPT_HEADEROPT;
592+
}
593+
591594
$methodOpts = [
592595
\CURLOPT_POST,
593596
\CURLOPT_PUT,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.