Skip to content

Commit d2464f4

Browse files
Merge branch '5.2' into 5.3
* 5.2: [HttpClient] fix compat with cURL <= 7.37 Remove Debug component from patch-types.php [Config] fix tracking attributes in ReflectionClassResource [Process] Fix incorrect parameter type [HttpFoundation] Handle tentative return types
2 parents b8aa780 + 697ddb7 commit d2464f4

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CurlHttpClient.php

Lines 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
}
@@ -552,7 +552,6 @@ private function validateExtraCurlOptions(array $options): void
552552
\CURLOPT_HEADER,
553553
\CURLOPT_CONNECTTIMEOUT,
554554
\CURLOPT_CONNECTTIMEOUT_MS,
555-
\CURLOPT_HEADEROPT,
556555
\CURLOPT_HTTP_VERSION,
557556
\CURLOPT_PORT,
558557
\CURLOPT_DNS_USE_GLOBAL_CACHE,
@@ -566,6 +565,10 @@ private function validateExtraCurlOptions(array $options): void
566565
$curloptsToCheck[] = \CURLOPT_HTTP09_ALLOWED;
567566
}
568567

568+
if (\defined('CURLOPT_HEADEROPT')) {
569+
$curloptsToCheck[] = \CURLOPT_HEADEROPT;
570+
}
571+
569572
$methodOpts = [
570573
\CURLOPT_POST,
571574
\CURLOPT_PUT,

0 commit comments

Comments
 (0)